{"record":{"id":"bbd448109d121dda","repo":"googleapis/mcp-toolbox","slug":"failed-to-list-data-products-w","errorCode":null,"errorMessage":"failed to list data products: %w","messagePattern":"failed to list data products: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/dataplex/dataplex.go","lineNumber":460,"sourceCode":"\t\tParent:   parent,\n\t\tFilter:   filter,\n\t\tPageSize: int32(pageSize),\n\t\tOrderBy:  orderBy,\n\t}\n\n\tit := s.GetDataProductClient().ListDataProducts(ctx, req)\n\tvar results []*DataProductSummary\n\n\tfor len(results) < pageSize {\n\t\tdp, err := it.Next()\n\t\tif err == iterator.Done {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tif st, ok := grpcstatus.FromError(err); ok {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to list data products: code=%s message=%s\", st.Code(), st.Message())\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"failed to list data products: %w\", err)\n\t\t}\n\t\tparts := strings.Split(dp.GetName(), \"/\")\n\t\tvar locID, prodID string\n\t\tif len(parts) >= 6 && parts[0] == \"projects\" && parts[2] == \"locations\" && parts[4] == \"dataProducts\" {\n\t\t\tlocID = parts[3]\n\t\t\tprodID = parts[5]\n\t\t}\n\t\tresults = append(results, &DataProductSummary{\n\t\t\tLocationID:    locID,\n\t\t\tDataProductID: prodID,\n\t\t\tDisplayName:   dp.GetDisplayName(),\n\t\t\tOwnerEmails:   dp.GetOwnerEmails(),\n\t\t\tAssetCount:    dp.GetAssetCount(),\n\t\t})\n\t}\n\treturn results, nil\n}\n","sourceCodeStart":442,"sourceCodeEnd":478,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/dataplex/dataplex.go#L442-L478","documentation":"This is the fallback branch of the same ListDataProducts failure path: the iterator returned an error that does not carry a gRPC status, so the library wraps it with %w to preserve the original cause. It indicates a client-side or transport-level problem rather than an API-reported status.","triggerScenarios":"Non-gRPC errors from iterator.Next() during ListDataProducts: context cancellation/deadline, connection resets, or unexpected client/serialization errors while paging through data products.","commonSituations":"Context cancelled by an HTTP request handler timeout mid-pagination; intermittent network failures; SDK internal errors surfaced without a grpc status.","solutions":["Unwrap the error (errors.Is/As) to find the root cause.","Ensure the context is alive with sufficient timeout for full pagination.","Retry with backoff if the cause is transient network failure.","Check proxy/firewall stability for long-running list operations."],"exampleFix":"// before\nctx := r.Context() // handler context, may be cancelled early\n// after\nctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)\ndefer cancel()","handlingStrategy":"retry","validationCode":"if err := ctx.Err(); err != nil { return nil, fmt.Errorf(\"context not viable: %w\", err) }","typeGuard":null,"tryCatchPattern":"var products []*DataProductSummary\nerr := retry.Do(func() error {\n\tvar e error\n\tproducts, e = src.ListDataProducts(ctx, filter, pageSize, orderBy)\n\treturn e\n}, retry.Attempts(3), retry.Delay(time.Second))","preventionTips":["Use generous timeouts for paginated list operations.","Implement retry-with-backoff for transient transport errors.","Avoid sharing a request-scoped context that may be cancelled early.","Monitor network stability between client and googleapis endpoints."],"tags":["gcp","dataplex","grpc","network","pagination"],"backgroundTag":"grpc-transport-error","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"}