{"record":{"id":"82134add0bec8f0c","repo":"googleapis/mcp-toolbox","slug":"failed-to-get-table-w","errorCode":null,"errorMessage":"failed to get table: %w","messagePattern":"failed to get table: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/bigtable/admin_wrappers.go","lineNumber":134,"sourceCode":"\terr := s.InstanceAdmin.UpdateCluster(ctx, instanceId, clusterId, serveNodes)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to update cluster: %w\", err)\n\t}\n\treturn map[string]string{\"status\": \"cluster updated successfully\"}, nil\n}\n\nfunc (s *Source) DeleteCluster(ctx context.Context, instanceId, clusterId string) (any, error) {\n\terr := s.InstanceAdmin.DeleteCluster(ctx, instanceId, clusterId)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to delete cluster: %w\", err)\n\t}\n\treturn map[string]string{\"status\": \"cluster deleted successfully\"}, nil\n}\n\nfunc (s *Source) GetTable(ctx context.Context, tableId string) (any, error) {\n\ttable, err := s.Admin.TableInfo(ctx, tableId)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get table: %w\", err)\n\t}\n\treturn table, nil\n}\n\nfunc (s *Source) CreateTable(ctx context.Context, tableId, columnFamily string) (any, error) {\n\terr := s.Admin.CreateTable(ctx, tableId)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create table: %w\", err)\n\t}\n\tif columnFamily != \"\" {\n\t\tif err := s.Admin.CreateColumnFamily(ctx, tableId, columnFamily); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create column family: %w\", err)\n\t\t}\n\t}\n\treturn map[string]string{\"status\": \"table created successfully\"}, nil\n}\n\nfunc (s *Source) DeleteTable(ctx context.Context, tableId string) (any, error) {","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/bigtable/admin_wrappers.go#L116-L152","documentation":"This error wraps failures from the Bigtable Admin client's TableInfo call in Source.GetTable. The library wraps the underlying error with fmt.Errorf(\"failed to get table: %w\", err); the real cause (table not found, permission denied, network) is preserved in the error chain. Resolve the wrapped gRPC status to diagnose.","triggerScenarios":"Calling the bigtable get_table tool where s.Admin.TableInfo(ctx, tableId) returns an error: tableId does not exist in the instance, caller lacks bigtable.tables.get, or the gRPC metadata/table administer client fails (timeout, endpoint unreachable).","commonSituations":"Querying a table by name instead of its plain ID (IDs exclude the project/instance prefix); table deleted by another process; service account without Bigtable Viewer/Admin; transient network errors or emulator misconfiguration (BIGTABLE_EMULATOR_HOST).","solutions":["Verify tableId is the bare table ID (e.g. \"my-table\", not \"projects/p/instances/i/tables/my-table\") and exists via list_tables.","Check IAM roles (roles/bigtable.viewer or admin) for the service account.","If using the emulator, confirm BIGTABLE_EMULATOR_HOST is set and the emulator is running.","Retry transient gRPC failures with backoff; inspect status.Code(err) for NotFound vs PermissionDenied."],"exampleFix":"// before: raw tableId from user input may include a full path\nerr := s.Admin.TableInfo(ctx, tableId)\n// after: normalize input to a bare table ID first\ntableId = path.Base(tableId)\nerr := s.Admin.TableInfo(ctx, tableId)","handlingStrategy":"try-catch","validationCode":"// Go: normalize and validate table ID before lookup\ntableId = path.Base(strings.TrimSpace(tableId))\nif !regexp.MustCompile(`^[_a-zA-Z0-9][-_.a-zA-Z0-9]*$`).MatchString(tableId) {\n    return fmt.Errorf(\"invalid table id: %q\", tableId)\n}","typeGuard":"func isTableNotFound(err error) bool {\n    return status.Code(err) == codes.NotFound\n}","tryCatchPattern":"table, err := src.GetTable(ctx, tableId)\nif err != nil {\n    if status.Code(err) == codes.NotFound {\n        return fmt.Errorf(\"table %q does not exist\", tableId)\n    }\n    return fmt.Errorf(\"get table: %w\", err)\n}","preventionTips":["Always pass bare table IDs, never fully-qualified table names.","Verify the table exists via list_tables before fetching details.","Confirm emulator env vars (BIGTABLE_EMULATOR_HOST) in local dev.","Grant read roles (roles/bigtable.viewer) to the runtime identity."],"tags":["gcp","bigtable","grpc","iam","admin-api"],"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-08T15:18:49.778Z"}