{"record":{"id":"e49212fe1b3d71b9","repo":"googleapis/mcp-toolbox","slug":"failed-to-get-logical-view-w","errorCode":null,"errorMessage":"failed to get logical view: %w","messagePattern":"failed to get logical view: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/bigtable/admin_wrappers.go","lineNumber":184,"sourceCode":"}\n\nfunc (s *Source) UpdateTable(ctx context.Context, tableId string, disableChangeStream bool) (any, error) {\n\tvar err error\n\tif disableChangeStream {\n\t\terr = s.Admin.UpdateTableDisableChangeStream(ctx, tableId)\n\t} else {\n\t\terr = s.Admin.UpdateTableWithChangeStream(ctx, tableId, 24*time.Hour)\n\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","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/bigtable/admin_wrappers.go#L166-L202","documentation":"This error wraps failures from the Bigtable InstanceAdmin client's LogicalViewInfo call in Source.GetLogicalView. The library wraps the underlying error with fmt.Errorf(\"failed to get logical view: %w\", err); the real gRPC cause (view not found, permissions, network) stays in the wrapped chain.","triggerScenarios":"Calling the bigtable get_logical_view tool where s.InstanceAdmin.LogicalViewInfo(ctx, instanceId, logicalViewId) errors: the logical view ID does not exist under the instance, instanceId is wrong, caller lacks bigtable views get permission (roles/bigtable.admin or viewer on views), or a transient gRPC failure occurs.","commonSituations":"Fetching a view that was deleted or renamed; confusing view IDs with view display names; service account without the relatively new logical-view IAM permissions; older client library versions lacking the LogicalViewInfo API against newer servers.","solutions":["List logical views first (list_logical_views) to confirm the exact view ID and instance.","Check IAM for view-read permissions (roles/bigtable.admin or appropriate bigtable.views.* grants).","Upgrade cloud.google.com/go/bigtable if the API is unsupported or the server returns Unimplemented.","Retry transient gRPC errors with backoff; inspect status.Code(err) for the specific cause."],"exampleFix":"// before\nview, err := s.InstanceAdmin.LogicalViewInfo(ctx, instanceId, logicalViewId)\n// after: pre-check existence via list\nviews, _ := s.InstanceAdmin.LogicalViews(ctx, instanceId)\nif !containsView(views, logicalViewId) {\n    return nil, fmt.Errorf(\"logical view %q not found in instance %q\", logicalViewId, instanceId)\n}","handlingStrategy":"try-catch","validationCode":"// Go: check the view exists before fetching details\nviews, err := instanceAdmin.LogicalViews(ctx, instanceId)\nif err != nil {\n    return fmt.Errorf(\"cannot enumerate views: %w\", err)\n}\nfound := false\nfor _, v := range views {\n    if v.ID == logicalViewId { found = true }\n}\nif !found {\n    return fmt.Errorf(\"logical view %q not found in %q\", logicalViewId, instanceId)\n}","typeGuard":"func isViewNotFound(err error) bool {\n    return status.Code(err) == codes.NotFound\n}","tryCatchPattern":"view, err := src.GetLogicalView(ctx, instanceId, viewId)\nif err != nil {\n    if status.Code(err) == codes.NotFound {\n        return fmt.Errorf(\"logical view %q does not exist\", viewId)\n    }\n    return fmt.Errorf(\"get logical view: %w\", err)\n}","preventionTips":["List logical views to get exact IDs before calling Get.","Distinguish view IDs from display names.","Grant bigtable views permissions (roles/bigtable.admin or views grants).","Upgrade the bigtable client module if LogicalViewInfo returns Unimplemented."],"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"}