googleapis/mcp-toolbox · error
failed to list data assets: %w
Error message
failed to list data assets: %w
What it means
Fallback branch of the ListDataAssets error path: the iterator returned an error with no gRPC status, so the library wraps the raw cause with %w. This points to a client-side or transport problem instead of an API-reported status.
Source
Thrown at internal/sources/dataplex/dataplex.go:580
Parent: parent,
Filter: filter,
PageSize: int32(pageSize),
OrderBy: orderBy,
}
it := s.GetDataProductClient().ListDataAssets(ctx, req)
var results []*DataAsset
for len(results) < pageSize {
asset, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
if st, ok := grpcstatus.FromError(err); ok {
return nil, fmt.Errorf("failed to list data assets: code=%s message=%s", st.Code(), st.Message())
}
return nil, fmt.Errorf("failed to list data assets: %w", err)
}
parts := strings.Split(asset.GetName(), "/")
var locID, prodID, assetID string
if len(parts) >= 8 && parts[0] == "projects" && parts[2] == "locations" && parts[4] == "dataProducts" && parts[6] == "dataAssets" {
locID = parts[3]
prodID = parts[5]
assetID = parts[7]
}
results = append(results, &DataAsset{
LocationID: locID,
DataProductID: prodID,
DataAssetID: assetID,
ResourceURI: asset.GetResource(),
Labels: asset.GetLabels(),
})
}
return results, nil
}View on GitHub (pinned to 8cc6e09de2)
Solutions
- Unwrap the error to identify the root cause.
- Increase the context timeout or pass a fresh context for pagination.
- Retry with backoff for transient network issues.
- Confirm credentials/token refresh works (gcloud auth application-default login).
Example fix
// before assets, err := src.ListDataAssets(ctx, ...) // ctx nearly expired // after ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) defer cancel() assets, err := src.ListDataAssets(ctx, ...)
Defensive patterns
Strategy: retry
Validate before calling
if err := ctx.Err(); err != nil { return nil, fmt.Errorf("context already done: %w", err) } Try / catch
var assets []*DataAsset
err := retry.Do(func() error {
var e error
assets, e = src.ListDataAssets(ctx, locID, prodID, filter, pageSize, orderBy)
return e
}, retry.Attempts(3), retry.DelayType(retry.BackOffDelay)) Prevention
- Allocate sufficient context timeout for full asset pagination.
- Retry transient errors with exponential backoff.
- Ensure stable connectivity; avoid flaky proxies for googleapis traffic.
- Refresh credentials before long-running listing sessions.
When it happens
Trigger: Non-gRPC errors from iterator.Next() while paging data assets: context cancellation or deadline exceeded, dropped connections, or client/serialization errors.
Common situations: Request handler context expiring during long pagination; unstable network or proxy; transient token refresh failures surfaced as plain errors.
Related errors
- failed to list data scans: %w
- failed to list data products: %w
- failed to create Dataplex client for project %q: %w
- failed to list tables: %w
- failed to create Dataplex client for project %q: %w
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/94a5fc54daeaae3c.
Report an issue: GitHub.