{"record":{"id":"e41498d31857edf2","repo":"googleapis/mcp-toolbox","slug":"error-extracting-batch-details-from-name-q-v","errorCode":null,"errorMessage":"error extracting batch details from name %q: %v","messagePattern":"error extracting batch details from name %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/serverlessspark/serverlessspark.go","lineNumber":189,"sourceCode":"func (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.\ntype ListBatchesResponse struct {\n\tBatches       []Batch `json:\"batches\"`\n\tNextPageToken string  `json:\"nextPageToken\"`\n}\n","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/serverlessspark/serverlessspark.go#L171-L207","documentation":"ExtractBatchDetails could not regex-match the batch name returned in the operation metadata against the expected projects/<project>/locations/<location>/batches/<batch_id> shape, so the created batch cannot be decomposed into project, location and batch ID.","triggerScenarios":"Thrown at internal/sources/serverlessspark/serverlessspark.go:189 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the returned batch name in the error to see the malformed shape","Verify the Dataproc API version returns fully qualified batch names","Report if the resource-name format changed upstream"],"exampleFix":null,"handlingStrategy":"validation","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"}