googleapis/mcp-toolbox · error
failed to get create batch op metadata: %w
Error message
failed to get create batch op metadata: %w
What it means
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.
Source
Thrown at internal/sources/serverlessspark/serverlessspark.go:184
return nil, fmt.Errorf("failed to cancel operation: %w", err)
}
return fmt.Sprintf("Cancelled [%s].", operation), nil
}
func (s *Source) CreateBatch(ctx context.Context, batch *dataprocpb.Batch) (map[string]any, error) {
req := &dataprocpb.CreateBatchRequest{
Parent: fmt.Sprintf("projects/%s/locations/%s", s.GetProject(), s.GetLocation()),
Batch: batch,
}
client := s.GetBatchControllerClient()
op, err := client.CreateBatch(ctx, req)
if err != nil {
return nil, fmt.Errorf("failed to create batch: %w", err)
}
meta, err := op.Metadata()
if err != nil {
return nil, fmt.Errorf("failed to get create batch op metadata: %w", err)
}
projectID, location, batchID, err := ExtractBatchDetails(meta.GetBatch())
if err != nil {
return nil, fmt.Errorf("error extracting batch details from name %q: %v", meta.GetBatch(), err)
}
consoleUrl := BatchConsoleURL(projectID, location, batchID)
logsUrl := BatchLogsURL(projectID, location, batchID, meta.GetCreateTime().AsTime(), time.Time{})
wrappedResult := map[string]any{
"opMetadata": meta,
"consoleUrl": consoleUrl,
"logsUrl": logsUrl,
}
return wrappedResult, nil
}
// ListBatchesResponse is the response from the list batches API.View on GitHub (pinned to 8cc6e09de2)
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
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at internal/sources/serverlessspark/serverlessspark.go:184 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/6623fbc40e450f65.
Report an issue: GitHub.