{"record":{"id":"95198fbb87838548","repo":"googleapis/mcp-toolbox","slug":"failed-to-parse-session-template-name-s","errorCode":null,"errorMessage":"failed to parse session template name: %s","messagePattern":"failed to parse session template name: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/serverlessspark/url.go","lineNumber":98,"sourceCode":"\treturn BatchConsoleURL(projectID, location, batchID), nil\n}\n\n// BatchLogsURLFromProto builds a URL to the Google Cloud Console showing Cloud Logging for the given batch and time range.\nfunc BatchLogsURLFromProto(batchPb *dataprocpb.Batch) (string, error) {\n\tprojectID, location, batchID, err := ExtractBatchDetails(batchPb.GetName())\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tcreateTime := batchPb.GetCreateTime().AsTime()\n\tstateTime := batchPb.GetStateTime().AsTime()\n\treturn BatchLogsURL(projectID, location, batchID, createTime, stateTime), nil\n}\n\n// ExtractSessionTemplateDetails extracts the project ID, location, and session template ID from a fully qualified sessionTemplateName.\nfunc ExtractSessionTemplateDetails(sessionTemplateName string) (projectID, location, sessionTemplateID string, err error) {\n\tmatches := sessionTemplateFullNameRegex.FindStringSubmatch(sessionTemplateName)\n\tif len(matches) < 4 {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"failed to parse session template name: %s\", sessionTemplateName)\n\t}\n\treturn matches[1], matches[2], matches[3], nil\n}\n\nvar sessionFullNameRegex = regexp.MustCompile(`projects/(?P<project>[^/]+)/locations/(?P<location>[^/]+)/sessions/(?P<session_id>[^/]+)`)\n\n// ExtractSessionDetails extracts the project ID, location, and session ID from a fully qualified session name.\nfunc ExtractSessionDetails(sessionName string) (projectID, location, sessionID string, err error) {\n\tmatches := sessionFullNameRegex.FindStringSubmatch(sessionName)\n\tif len(matches) < 4 {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"failed to parse session name: %s\", sessionName)\n\t}\n\treturn matches[1], matches[2], matches[3], nil\n}\n\n// SessionConsoleURL builds a URL to the Google Cloud Console linking to the session summary page.\nfunc SessionConsoleURL(projectID, location, sessionID string) string {\n\treturn fmt.Sprintf(\"https://console.cloud.google.com/dataproc/interactive/%s/%s/details?project=%s\", location, sessionID, projectID)","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/serverlessspark/url.go#L80-L116","documentation":"The sessionTemplateFullNameRegex failed to match the given session template name: it does not follow projects/<project>/locations/<location>/sessionTemplates/<template_id>, so its components cannot be extracted.","triggerScenarios":"Thrown at internal/sources/serverlessspark/url.go:98 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a fully qualified template name of the form projects/P/locations/L/sessionTemplates/T","Check for typos or extra path segments","Verify the value came from the Dataproc API unmodified"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}