{"record":{"id":"797ba7778b2ca7b0","repo":"googleapis/mcp-toolbox","slug":"failed-to-create-longrunning-client-w-797ba7","errorCode":null,"errorMessage":"failed to create longrunning client: %w","messagePattern":"failed to create longrunning client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/serverlessspark/serverlessspark.go","lineNumber":86,"sourceCode":"\tua, err := util.UserAgentFromContext(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error in User Agent retrieval: %s\", err)\n\t}\n\tendpoint := fmt.Sprintf(\"%s-dataproc.googleapis.com:443\", r.Location)\n\tbatchClient, err := dataproc.NewBatchControllerClient(ctx, option.WithEndpoint(endpoint), option.WithUserAgent(ua))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create dataproc batch client: %w\", err)\n\t}\n\tsessionTemplateClient, err := dataproc.NewSessionTemplateControllerClient(ctx, option.WithEndpoint(endpoint), option.WithUserAgent(ua))\n\tif err != nil {\n\t\tbatchClient.Close()\n\t\treturn nil, fmt.Errorf(\"failed to create dataproc session template client: %w\", err)\n\t}\n\topsClient, err := longrunning.NewOperationsClient(ctx, option.WithEndpoint(endpoint), option.WithUserAgent(ua))\n\tif err != nil {\n\t\tbatchClient.Close()\n\t\tsessionTemplateClient.Close()\n\t\treturn nil, fmt.Errorf(\"failed to create longrunning client: %w\", err)\n\t}\n\tsessionClient, err := dataproc.NewSessionControllerClient(ctx, option.WithEndpoint(endpoint), option.WithUserAgent(ua))\n\tif err != nil {\n\t\tbatchClient.Close()\n\t\tsessionTemplateClient.Close()\n\t\topsClient.Close()\n\t\treturn nil, fmt.Errorf(\"failed to create dataproc session client: %w\", err)\n\t}\n\n\ts := &Source{\n\t\tConfig:                r,\n\t\tBatchClient:           batchClient,\n\t\tSessionTemplateClient: sessionTemplateClient,\n\t\tOpsClient:             opsClient,\n\t\tSessionClient:         sessionClient,\n\t}\n\treturn s, nil\n}","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/serverlessspark/serverlessspark.go#L68-L104","documentation":"The Google Cloud Dataproc BatchControllerClient could not be created during source Initialize, usually because Application Default Credentials are missing/unauthorized or the regional endpoint (<location>-dataproc.googleapis.com:443) is unreachable.","triggerScenarios":"Thrown at internal/sources/serverlessspark/serverlessspark.go:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run gcloud auth application-default login or set GOOGLE_APPLICATION_CREDENTIALS","Verify the Dataproc API is enabled and the location is valid","Check network access to the regional Dataproc endpoint"],"exampleFix":null,"handlingStrategy":"retry","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"}