googleapis/mcp-toolbox · error
failed to list logical views: %w
Error message
failed to list logical views: %w
What it means
This error wraps failures from the Bigtable InstanceAdmin client's LogicalViews call in Source.ListLogicalViews. The library wraps the underlying error with fmt.Errorf("failed to list logical views: %w", err) while keeping the original gRPC error accessible via errors.As/Unwrap. It means the listing RPC itself failed, not that any individual view is malformed.
Source
Thrown at internal/sources/bigtable/admin_wrappers.go:192
}
if err != nil {
return nil, fmt.Errorf("failed to update table: %w", err)
}
return map[string]string{"status": "table updated successfully"}, nil
}
func (s *Source) GetLogicalView(ctx context.Context, instanceId, logicalViewId string) (any, error) {
view, err := s.InstanceAdmin.LogicalViewInfo(ctx, instanceId, logicalViewId)
if err != nil {
return nil, fmt.Errorf("failed to get logical view: %w", err)
}
return view, nil
}
func (s *Source) ListLogicalViews(ctx context.Context, instanceId string) (any, error) {
views, err := s.InstanceAdmin.LogicalViews(ctx, instanceId)
if err != nil {
return nil, fmt.Errorf("failed to list logical views: %w", err)
}
return views, nil
}
func (s *Source) ListMaterializedViews(ctx context.Context, instanceId string) (any, error) {
views, err := s.InstanceAdmin.MaterializedViews(ctx, instanceId)
if err != nil {
return nil, fmt.Errorf("failed to list materialized views: %w", err)
}
return views, nil
}
func (s *Source) CreateLogicalView(ctx context.Context, instanceId, logicalViewId, query string) (any, error) {
conf := &bigtable.LogicalViewInfo{
LogicalViewID: logicalViewId,
Query: query,
}
err := s.InstanceAdmin.CreateLogicalView(ctx, instanceId, conf)View on GitHub (pinned to 8cc6e09de2)
Solutions
- Verify instanceId exists in the project the Source client was initialized with (list instances or check config).
- Grant the caller roles/bigtable.admin (or view-list permissions) and confirm ADC credentials are set.
- Upgrade cloud.google.com/go/bigtable to a version that supports logical views if you get Unimplemented.
- Retry transient gRPC errors with backoff; check status.Code(err) to distinguish NotFound/PermissionDenied/Unimplemented.
Example fix
// before
return nil, fmt.Errorf("failed to list logical views: %w", err)
// after: include the gRPC status code in the wrapped error
return nil, fmt.Errorf("failed to list logical views (code=%s): %w", status.Code(err), err) Defensive patterns
Strategy: retry
Validate before calling
// Go: pre-flight for listing logical views
if instanceId == "" {
return fmt.Errorf("instanceId is required")
}
// ensure credentials & module capability
if !logicalViewsSupported { // feature-detected at startup
return fmt.Errorf("installed bigtable client does not support logical views")
} Type guard
func isListRetryable(err error) bool {
c := status.Code(err)
return c == codes.Unavailable || c == codes.DeadlineExceeded
} Try / catch
views, err := src.ListLogicalViews(ctx, instanceId)
if err != nil {
switch status.Code(err) {
case codes.NotFound:
return fmt.Errorf("instance %q not found", instanceId)
case codes.PermissionDenied:
return fmt.Errorf("missing bigtable views list permission")
case codes.Unimplemented:
return fmt.Errorf("upgrade cloud.google.com/go/bigtable for logical views")
default:
return fmt.Errorf("list logical views: %w", err)
}
} Prevention
- Confirm the instance ID and that the client was bound to the same project.
- Grant view-list IAM permissions to the runtime service account.
- Keep cloud.google.com/go/bigtable current — logical views are a newer API.
- Retry transient Unavailable/DeadlineExceeded with exponential backoff.
When it happens
Trigger: Calling the bigtable list_logical_views tool where s.InstanceAdmin.LogicalViews(ctx, instanceId) errors: the instance does not exist, caller lacks bigtable.views.list permission, the installed client library predates logical views (Unimplemented), or network/quota/transient gRPC failure.
Common situations: Wrong instance ID or querying an instance in a different project than the client was bound to; missing IAM grants for the newer logical-view APIs; outdated cloud.google.com/go/bigtable module; regional outage or proxy blocking the admin endpoint.
Related errors
- failed to get logical view: %w
- failed to update cluster: %w
- failed to delete cluster: %w
- failed to get table: %w
- failed to create table: %w
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/f06263f61c266d90.
Report an issue: GitHub.