{"record":{"id":"5ac813f41be0129f","repo":"googleapis/mcp-toolbox","slug":"failed-to-create-dataproc-job-client-w","errorCode":null,"errorMessage":"failed to create dataproc job client: %w","messagePattern":"failed to create dataproc job client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/dataproc/dataproc.go","lineNumber":85,"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.Region)\n\tclient, err := dataproc.NewClusterControllerClient(ctx, option.WithEndpoint(endpoint), option.WithUserAgent(ua))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create dataproc client: %w\", err)\n\t}\n\topsClient, err := longrunning.NewOperationsClient(ctx, option.WithEndpoint(endpoint), option.WithUserAgent(ua))\n\tif err != nil {\n\t\tclient.Close()\n\t\treturn nil, fmt.Errorf(\"failed to create longrunning client: %w\", err)\n\t}\n\tjobClient, err := dataproc.NewJobControllerClient(ctx, option.WithEndpoint(endpoint), option.WithUserAgent(ua))\n\tif err != nil {\n\t\tclient.Close()\n\t\topsClient.Close()\n\t\treturn nil, fmt.Errorf(\"failed to create dataproc job client: %w\", err)\n\t}\n\n\ts := &Source{\n\t\tConfig:    r,\n\t\tClient:    client,\n\t\tOpsClient: opsClient,\n\t\tJobClient: jobClient,\n\t}\n\treturn s, nil\n}\n\nvar _ sources.Source = &Source{}\n\ntype Source struct {\n\tConfig\n\tClient    *dataproc.ClusterControllerClient\n\tOpsClient *longrunning.OperationsClient\n\tJobClient *dataproc.JobControllerClient","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/dataproc/dataproc.go#L67-L103","documentation":"Thrown by the Dataproc source's Config.Initialize when dataproc.NewJobControllerClient fails after both the cluster controller and operations clients were created. Both prior clients are closed before returning to prevent resource leaks. Initialization of the whole dataproc source fails.","triggerScenarios":"Third client creation (JobController) against `<region>-dataproc.googleapis.com:443` fails — network interruption mid-initialization, quota/connection limits, or auth errors.","commonSituations":"Same family as the other client-creation failures: regional endpoint problems, proxies killing long-lived connections, credentials expiring during setup.","solutions":["Retry initialization; verify stable network access to the regional endpoint.","Validate credentials and ensure the Dataproc API is enabled.","Inspect the wrapped (%w) error for the specific gRPC status.","Ensure connection/firewall limits allow multiple concurrent gRPC channels."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"null","typeGuard":"null","tryCatchPattern":"src, err := cfg.Initialize(ctx, tracer)\nif err != nil {\n    if strings.Contains(err.Error(), \"dataproc job client\") {\n        // retry initialization; prior clients are already closed by the library\n    }\n    return err\n}","preventionTips":["Retry initialization with exponential backoff for transient failures.","Ensure firewall/proxy rules permit multiple concurrent gRPC channels to the endpoint.","Validate credentials and API enablement before startup."],"tags":["gcp","dataproc","grpc","client-initialization"],"backgroundTag":"gcp-client-creation-failed","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"}