{"record":{"id":"756cf4bcc62732bc","repo":"googleapis/mcp-toolbox","slug":"failed-to-list-tables-w","errorCode":null,"errorMessage":"failed to list tables: %w","messagePattern":"failed to list tables: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/bigtable/admin_wrappers.go","lineNumber":163,"sourceCode":"\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) {\n\terr := s.Admin.DeleteTable(ctx, tableId)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to delete table: %w\", err)\n\t}\n\treturn map[string]string{\"status\": \"table deleted successfully\"}, nil\n}\n\nfunc (s *Source) ListTables(ctx context.Context) (any, error) {\n\ttables, err := s.Admin.Tables(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list tables: %w\", err)\n\t}\n\treturn tables, nil\n}\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) {","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/bigtable/admin_wrappers.go#L145-L181","documentation":"This error wraps failures from the Bigtable Admin client's Tables call in Source.ListTables. The library wraps the underlying error with fmt.Errorf(\"failed to list tables: %w\", err) so the underlying gRPC status and details remain retrievable. It indicates listing failed entirely, not that any individual table is problematic.","triggerScenarios":"Calling the bigtable list_tables tool where s.Admin.Tables(ctx) errors: the bound instance does not exist or the client was opened with a bad project/instance, caller lacks bigtable.tables.list, network/proxy blocking the Bigtable admin endpoint, or quota/transient gRPC failure.","commonSituations":"Client initialized against a nonexistent project or instance ID; workload running without default credentials (GOOGLE_APPLICATION_CREDENTIALS unset); corporate proxy/firewall blocking bigtableadmin.googleapis.com; regional outage.","solutions":["Verify the Source was initialized with a valid project and instance ID (check where the Admin client is created).","Ensure Application Default Credentials are configured (GOOGLE_APPLICATION_CREDENTIALS or metadata server) and include roles/bigtable.viewer or admin.","Test network reachability to bigtableadmin.googleapis.com from the runtime environment (proxy/VPN/firewall).","Retry transient gRPC failures with backoff; check status.Code(err) for PermissionDenied vs Unavailable."],"exampleFix":"// before\nreturn nil, fmt.Errorf(\"failed to list tables: %w\", err)\n// after: surface the gRPC code for easier triage\nreturn nil, fmt.Errorf(\"failed to list tables (code=%s): %w\", status.Code(err), err)","handlingStrategy":"retry","validationCode":"// Go: pre-flight before listing tables\nif os.Getenv(\"GOOGLE_APPLICATION_CREDENTIALS\") == \"\" && !metadata.OnGCE() && os.Getenv(\"BIGTABLE_EMULATOR_HOST\") == \"\" {\n    return fmt.Errorf(\"no credentials configured for Bigtable admin client\")\n}\nif projectId == \"\" || instanceId == \"\" {\n    return fmt.Errorf(\"project and instance must be configured\")\n}","typeGuard":"func isRetryable(err error) bool {\n    c := status.Code(err)\n    return c == codes.Unavailable || c == codes.DeadlineExceeded || c == codes.ResourceExhausted\n}","tryCatchPattern":"tables, err := src.ListTables(ctx)\nif err != nil && isRetryable(err) {\n    tables, err = retryWithBackoff(3, func() (any, error) { return src.ListTables(ctx) })\n}\nif err != nil {\n    return fmt.Errorf(\"list tables: %w\", err)\n}","preventionTips":["Set GOOGLE_APPLICATION_CREDENTIALS or run on a GCP metadata-enabled host.","Verify project/instance binding where the Admin client is constructed.","Allowlist bigtableadmin.googleapis.com in firewalls/proxies.","Wrap read-only list calls in automatic retry with exponential backoff."],"tags":["gcp","bigtable","grpc","iam","network"],"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"}