{"record":{"id":"76372d1071fe60eb","repo":"googleapis/mcp-toolbox","slug":"failed-to-parse-session-name-s","errorCode":null,"errorMessage":"failed to parse session name: %s","messagePattern":"failed to parse session name: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/serverlessspark/url.go","lineNumber":109,"sourceCode":"\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)\n}\n\n// SessionLogsURL builds a URL to the Google Cloud Console showing Cloud Logging for the given session and time range.\nfunc SessionLogsURL(projectID, location, sessionID string, startTime, endTime time.Time) string {\n\tadvancedFilterTemplate := `resource.type=\"cloud_dataproc_session\"\nresource.labels.session_id=%q\nresource.labels.project_id=%q\nresource.labels.location=%q`\n\n\tadvancedFilter := fmt.Sprintf(advancedFilterTemplate, sessionID, projectID, location)\n","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/serverlessspark/url.go#L91-L127","documentation":"The session name regex failed to match the given session name: it does not follow projects/<project>/locations/<location>/sessions/<session_id>, so its components cannot be extracted for console/log URL construction.","triggerScenarios":"Thrown at internal/sources/serverlessspark/url.go:109 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a fully qualified session name of the form projects/P/locations/L/sessions/S","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"}