{"record":{"id":"a05f4da5d2040a73","repo":"googleapis/mcp-toolbox","slug":"invalid-operation-name-q","errorCode":null,"errorMessage":"invalid operation name: %q","messagePattern":"invalid operation name: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/dataplex/dataplex.go","lineNumber":678,"sourceCode":"\t\tParent:        parent,\n\t\tDataProductId: dataProductID,\n\t\tDataProduct: &dataplexpb.DataProduct{\n\t\t\tDisplayName:  displayName,\n\t\t\tDescription:  description,\n\t\t\tOwnerEmails:  ownerEmails,\n\t\t\tAccessGroups: agMap,\n\t\t},\n\t}\n\n\top, err := s.GetDataProductClient().CreateDataProduct(ctx, req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\topName := op.Name()\n\tparts := strings.Split(opName, \"/\")\n\tif len(parts) < 6 || parts[0] != \"projects\" || parts[2] != \"locations\" || parts[4] != \"operations\" {\n\t\treturn nil, fmt.Errorf(\"invalid operation name: %q\", opName)\n\t}\n\treturn map[string]string{\n\t\t\"locationId\":  parts[3],\n\t\t\"operationId\": parts[5],\n\t}, nil\n}\n\nfunc (s *Source) UpdateDataProduct(\n\tctx context.Context,\n\tlocationID string,\n\tdataProductID string,\n\tdescription string,\n\tdisplayName string,\n\townerEmails []string,\n\taccessGroups []AccessGroup,\n\tupdateMask []string,\n) (map[string]string, error) {\n\tname := fmt.Sprintf(\"projects/%s/locations/%s/dataProducts/%s\", s.ProjectID(), locationID, dataProductID)","sourceCodeStart":660,"sourceCodeEnd":696,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/dataplex/dataplex.go#L660-L696","documentation":"After CreateDataProduct submits the LRO, the library parses the returned long-running operation's name (expected form projects/{p}/locations/{l}/operations/{id}) to extract locationId and operationId. If the name does not match that shape, this error is thrown because the operation identifier cannot be interpreted.","triggerScenarios":"op.Name() from the Dataplex CreateDataProduct LRO returns a string that splits into fewer than 6 path segments or whose segments 0/2/4 are not projects/locations/operations — e.g. an empty name from a malformed API response or an unexpected name format.","commonSituations":"A Dataplex API/SDK behavior change altering operation name format; a stubbed or mocked client returning an empty operation name; proxy or test fake returning a partially populated LongRunningOperation.","solutions":["Log op.Name() to inspect the actual format returned.","Update the library/SDK to the latest version in case of a name-format change.","If using a mock/fake Dataplex client, make it return a properly formatted operation name 'projects/P/locations/L/operations/OP'.","Retry the create call; if persistent, capture the raw response and report to the library maintainers."],"exampleFix":"// before (mock returning empty op)\nop := &longrunningpb.Operation{}\n// after\nop := &longrunningpb.Operation{Name: \"projects/my-proj/locations/us-central1/operations/abc123\"}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func parseLROName(name string) (locID, opID string, ok bool) {\n\tparts := strings.Split(name, \"/\")\n\tif len(parts) < 6 || parts[0] != \"projects\" || parts[2] != \"locations\" || parts[4] != \"operations\" {\n\t\treturn \"\", \"\", false\n\t}\n\treturn parts[3], parts[5], true\n}","tryCatchPattern":"op, err := src.CreateDataProduct(ctx, params)\nif err != nil {\n\tif strings.Contains(err.Error(), \"invalid operation name\") {\n\t\tlog.Printf(\"unexpected LRO name format; check SDK version / mock setup\")\n\t}\n\treturn err\n}","preventionTips":["Pin compatible versions of the Dataplex Go SDK and this library.","Ensure test fakes return canonical LRO names 'projects/P/locations/L/operations/OP'.","Log raw LRO names in integration tests to catch format drift early.","Validate LRO responses with a parser before relying on extracted IDs."],"tags":["gcp","dataplex","lro","parsing","response-format"],"backgroundTag":"unexpected-response-format","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"}