{"record":{"id":"462175bcabd04610","repo":"googleapis/mcp-toolbox","slug":"failed-to-create-dataplex-dataproduct-client-for-p","errorCode":null,"errorMessage":"failed to create Dataplex DataProduct client for project %q: %w","messagePattern":"failed to create Dataplex DataProduct client for project %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/dataplex/dataplex.go","lineNumber":242,"sourceCode":"\t\t}\n\t}\n\n\tclient, err := dataplexapi.NewCatalogClient(ctx, opts...)\n\tif err != nil {\n\t\treturn nil, nil, nil, nil, fmt.Errorf(\"failed to create Dataplex client for project %q: %w\", project, err)\n\t}\n\n\tdataScanClient, err := dataplexapi.NewDataScanClient(ctx, opts...)\n\tif err != nil {\n\t\tclient.Close()\n\t\treturn nil, nil, nil, nil, fmt.Errorf(\"failed to create Dataplex DataScan client for project %q: %w\", project, err)\n\t}\n\n\tdataProductClient, err := dataplexapi.NewDataProductClient(ctx, opts...)\n\tif err != nil {\n\t\tclient.Close()\n\t\tdataScanClient.Close()\n\t\treturn nil, nil, nil, nil, fmt.Errorf(\"failed to create Dataplex DataProduct client for project %q: %w\", project, err)\n\t}\n\n\tprojectsClient, err := resourcemanager.NewProjectsClient(ctx, opts...)\n\tif err != nil {\n\t\tclient.Close()\n\t\tdataScanClient.Close()\n\t\tdataProductClient.Close()\n\t\treturn nil, nil, nil, nil, fmt.Errorf(\"failed to create ResourceManager projects client for project %q: %w\", project, err)\n\t}\n\n\treturn client, dataScanClient, dataProductClient, projectsClient, nil\n}\n\nfunc (s *Source) LookupEntry(ctx context.Context, name string, view int, aspectTypes []string, entry string) (*dataplexpb.Entry, error) {\n\tviewMap := map[int]dataplexpb.EntryView{\n\t\t1: dataplexpb.EntryView_BASIC,\n\t\t2: dataplexpb.EntryView_FULL,\n\t\t3: dataplexpb.EntryView_CUSTOM,","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/dataplex/dataplex.go#L224-L260","documentation":"The third Dataplex client (DataProduct API) is created with dataplexapi.NewDataProductClient. On failure, the previously created Catalog and DataScan clients are both closed before returning this wrapped error. Since two clients already constructed successfully, credentials and transport are likely fine and this points at a transient or version-specific failure.","triggerScenarios":"initDataplexConnection calls dataplexapi.NewDataProductClient(ctx, opts...) after Catalog and DataScan clients were created; failure triggers cleanup of both and aborts initialization.","commonSituations":"Older cloud.google.com/go/dataplex versions without DataProduct client support or with API changes; transient gRPC failures; resource exhaustion creating multiple concurrent connections (low fd limits).","solutions":["Retry initialization — the first two clients succeeded, so this is likely transient.","Update cloud.google.com/go/dataplex to the latest version (DataProduct client is newer; older versions may fail).","Check file-descriptor/connection limits if running in constrained containers (ulimit -n).","Verify the dataplex.googleapis.com API is enabled and reachable; if your library version predates the DataProduct API, upgrading is mandatory."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"go list -m cloud.google.com/go/dataplex  # verify recent version supporting NewDataProductClient","typeGuard":null,"tryCatchPattern":"src, err := cfg.Initialize(ctx, tracer)\nif err != nil {\n\tif strings.Contains(err.Error(), \"failed to create Dataplex DataProduct client\") {\n\t\treturn backoff.Retry(func() error { _, err := cfg.Initialize(ctx, tracer); return err }, backoff.NewExponentialBackOff())\n\t}\n\treturn err\n}","preventionTips":["Pin cloud.google.com/go/dataplex to a recent version that ships the DataProduct client.","Raise ulimit -n in constrained containers where many gRPC channels are opened.","Retry transient failures; escalate persistent ones with `go version -m` dependency output to maintainers."],"tags":["gcp","dataplex","client-construction","versioning","initialization"],"backgroundTag":"api-client-creation-failed","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"}