{"record":{"id":"4fae2f8027b22a65","repo":"googleapis/mcp-toolbox","slug":"failed-to-get-batch-w","errorCode":null,"errorMessage":"failed to get batch: %w","messagePattern":"failed to get batch: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/serverlessspark/serverlessspark.go","lineNumber":290,"sourceCode":"\t\t\tCreateTime: batchPb.CreateTime.AsTime().Format(time.RFC3339),\n\t\t\tOperation:  batchPb.Operation,\n\t\t\tConsoleURL: consoleUrl,\n\t\t\tLogsURL:    logsUrl,\n\t\t}\n\t\tbatches = append(batches, batch)\n\t}\n\treturn batches, nil\n}\n\nfunc (s *Source) GetBatch(ctx context.Context, name string) (map[string]any, error) {\n\tclient := s.GetBatchControllerClient()\n\treq := &dataprocpb.GetBatchRequest{\n\t\tName: fmt.Sprintf(\"projects/%s/locations/%s/batches/%s\", s.GetProject(), s.GetLocation(), name),\n\t}\n\n\tbatchPb, err := client.GetBatch(ctx, req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get batch: %w\", err)\n\t}\n\n\tjsonBytes, err := protojson.Marshal(batchPb)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to marshal batch to JSON: %w\", err)\n\t}\n\n\tvar result map[string]any\n\tif err := json.Unmarshal(jsonBytes, &result); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to unmarshal batch JSON: %w\", err)\n\t}\n\n\tconsoleUrl, err := BatchConsoleURLFromProto(batchPb)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error generating console url: %v\", err)\n\t}\n\tlogsUrl, err := BatchLogsURLFromProto(batchPb)\n\tif err != nil {","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/serverlessspark/serverlessspark.go#L272-L308","documentation":"The Dataproc GetBatch RPC failed for the requested batch name — the batch likely does not exist under the configured project/location, or the call hit permissions/connectivity issues.","triggerScenarios":"Thrown at internal/sources/serverlessspark/serverlessspark.go:290 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the batch ID exists in the configured project and location","Check IAM read permissions and network access","Retry on transient API failures"],"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"}