{"record":{"id":"2b413b621fc5bcf6","repo":"googleapis/mcp-toolbox","slug":"error-generating-logs-url-v-2b413b","errorCode":null,"errorMessage":"error generating logs url: %v","messagePattern":"error generating logs url: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/serverlessspark/serverlessspark.go","lineNumber":265,"sourceCode":"\tbatches, err := ToBatches(batchPbs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ListBatchesResponse{Batches: batches, NextPageToken: nextPageToken}, nil\n}\n\n// ToBatches converts a slice of protobuf Batch messages to a slice of Batch structs.\nfunc ToBatches(batchPbs []*dataprocpb.Batch) ([]Batch, error) {\n\tbatches := make([]Batch, 0, len(batchPbs))\n\tfor _, batchPb := range batchPbs {\n\t\tconsoleUrl, err := BatchConsoleURLFromProto(batchPb)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error generating console url: %v\", err)\n\t\t}\n\t\tlogsUrl, err := BatchLogsURLFromProto(batchPb)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error generating logs url: %v\", err)\n\t\t}\n\t\tbatch := Batch{\n\t\t\tName:       batchPb.Name,\n\t\t\tUUID:       batchPb.Uuid,\n\t\t\tState:      batchPb.State.Enum().String(),\n\t\t\tCreator:    batchPb.Creator,\n\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()","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/serverlessspark/serverlessspark.go#L247-L283","documentation":"BatchLogsURLFromProto failed for a listed batch: its resource name did not match the expected projects/.../batches/... pattern, so the Cloud Logging URL cannot be constructed during ToBatches conversion.","triggerScenarios":"Thrown at internal/sources/serverlessspark/serverlessspark.go:265 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the batch name format returned by the API","Validate the location/project embedded in the name","Skip or quarantine batches with malformed names"],"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"}