{"record":{"id":"6623fbc40e450f65","repo":"googleapis/mcp-toolbox","slug":"failed-to-get-create-batch-op-metadata-w","errorCode":null,"errorMessage":"failed to get create batch op metadata: %w","messagePattern":"failed to get create batch op metadata: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/serverlessspark/serverlessspark.go","lineNumber":184,"sourceCode":"\t\treturn nil, fmt.Errorf(\"failed to cancel operation: %w\", err)\n\t}\n\treturn fmt.Sprintf(\"Cancelled [%s].\", operation), nil\n}\n\nfunc (s *Source) CreateBatch(ctx context.Context, batch *dataprocpb.Batch) (map[string]any, error) {\n\treq := &dataprocpb.CreateBatchRequest{\n\t\tParent: fmt.Sprintf(\"projects/%s/locations/%s\", s.GetProject(), s.GetLocation()),\n\t\tBatch:  batch,\n\t}\n\n\tclient := s.GetBatchControllerClient()\n\top, err := client.CreateBatch(ctx, req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create batch: %w\", err)\n\t}\n\tmeta, err := op.Metadata()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get create batch op metadata: %w\", err)\n\t}\n\n\tprojectID, location, batchID, err := ExtractBatchDetails(meta.GetBatch())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error extracting batch details from name %q: %v\", meta.GetBatch(), err)\n\t}\n\tconsoleUrl := BatchConsoleURL(projectID, location, batchID)\n\tlogsUrl := BatchLogsURL(projectID, location, batchID, meta.GetCreateTime().AsTime(), time.Time{})\n\n\twrappedResult := map[string]any{\n\t\t\"opMetadata\": meta,\n\t\t\"consoleUrl\": consoleUrl,\n\t\t\"logsUrl\":    logsUrl,\n\t}\n\treturn wrappedResult, nil\n}\n\n// ListBatchesResponse is the response from the list batches API.","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/serverlessspark/serverlessspark.go#L166-L202","documentation":"op.Metadata() failed to fetch the long-running operation's metadata after CreateBatch succeeded — the operation may have already been deleted, or the metadata lookup hit a transient API error.","triggerScenarios":"Thrown at internal/sources/serverlessspark/serverlessspark.go:184 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry batch creation; metadata retrieval is occasionally transient","Check that the operation still exists in the Dataproc console","Inspect the wrapped error for the underlying gRPC status"],"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"}