{"record":{"id":"2e08e492b1c8048a","repo":"googleapis/mcp-toolbox","slug":"failed-to-create-dataproc-session-client-w","errorCode":null,"errorMessage":"failed to create dataproc session client: %w","messagePattern":"failed to create dataproc session client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/serverlessspark/serverlessspark.go","lineNumber":93,"sourceCode":"\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}\n\nvar _ sources.Source = &Source{}\n\ntype Source struct {\n\tConfig\n\tBatchClient           *dataproc.BatchControllerClient\n\tSessionTemplateClient *dataproc.SessionTemplateControllerClient","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/serverlessspark/serverlessspark.go#L75-L111","documentation":"The Cloud longrunning.OperationsClient failed to initialize after the batch and session-template clients had already been created; both earlier clients are closed before the error returns so the source does not leak connections.","triggerScenarios":"Thrown at internal/sources/serverlessspark/serverlessspark.go:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify ADC credentials and Dataproc API enablement for the project","Check network access to <location>-datapac.googleapis.com:443","Retry initialization after transient Google API outages"],"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-08T15:18:49.778Z"}