{"record":{"id":"f06263f61c266d90","repo":"googleapis/mcp-toolbox","slug":"failed-to-list-logical-views-w","errorCode":null,"errorMessage":"failed to list logical views: %w","messagePattern":"failed to list logical views: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/bigtable/admin_wrappers.go","lineNumber":192,"sourceCode":"\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to update table: %w\", err)\n\t}\n\treturn map[string]string{\"status\": \"table updated successfully\"}, nil\n}\n\nfunc (s *Source) GetLogicalView(ctx context.Context, instanceId, logicalViewId string) (any, error) {\n\tview, err := s.InstanceAdmin.LogicalViewInfo(ctx, instanceId, logicalViewId)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get logical view: %w\", err)\n\t}\n\treturn view, nil\n}\n\nfunc (s *Source) ListLogicalViews(ctx context.Context, instanceId string) (any, error) {\n\tviews, err := s.InstanceAdmin.LogicalViews(ctx, instanceId)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list logical views: %w\", err)\n\t}\n\treturn views, nil\n}\n\nfunc (s *Source) ListMaterializedViews(ctx context.Context, instanceId string) (any, error) {\n\tviews, err := s.InstanceAdmin.MaterializedViews(ctx, instanceId)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list materialized views: %w\", err)\n\t}\n\treturn views, nil\n}\n\nfunc (s *Source) CreateLogicalView(ctx context.Context, instanceId, logicalViewId, query string) (any, error) {\n\tconf := &bigtable.LogicalViewInfo{\n\t\tLogicalViewID: logicalViewId,\n\t\tQuery:         query,\n\t}\n\terr := s.InstanceAdmin.CreateLogicalView(ctx, instanceId, conf)","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/bigtable/admin_wrappers.go#L174-L210","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nreturn nil, fmt.Errorf(\"failed to list logical views: %w\", err)\n// after: include the gRPC status code in the wrapped error\nreturn nil, fmt.Errorf(\"failed to list logical views (code=%s): %w\", status.Code(err), err)","handlingStrategy":"retry","validationCode":"// Go: pre-flight for listing logical views\nif instanceId == \"\" {\n    return fmt.Errorf(\"instanceId is required\")\n}\n// ensure credentials & module capability\nif !logicalViewsSupported { // feature-detected at startup\n    return fmt.Errorf(\"installed bigtable client does not support logical views\")\n}","typeGuard":"func isListRetryable(err error) bool {\n    c := status.Code(err)\n    return c == codes.Unavailable || c == codes.DeadlineExceeded\n}","tryCatchPattern":"views, err := src.ListLogicalViews(ctx, instanceId)\nif err != nil {\n    switch status.Code(err) {\n    case codes.NotFound:\n        return fmt.Errorf(\"instance %q not found\", instanceId)\n    case codes.PermissionDenied:\n        return fmt.Errorf(\"missing bigtable views list permission\")\n    case codes.Unimplemented:\n        return fmt.Errorf(\"upgrade cloud.google.com/go/bigtable for logical views\")\n    default:\n        return fmt.Errorf(\"list logical views: %w\", err)\n    }\n}","preventionTips":["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."],"tags":["gcp","bigtable","grpc","iam","logical-views"],"backgroundTag":"gcp-grpc-admin-operation-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"}