{"record":{"id":"fc71900f3e6ac2d9","repo":"googleapis/mcp-toolbox","slug":"failed-to-update-table-w","errorCode":null,"errorMessage":"failed to update table: %w","messagePattern":"failed to update table: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/bigtable/admin_wrappers.go","lineNumber":176,"sourceCode":"}\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) {\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","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/bigtable/admin_wrappers.go#L158-L194","documentation":"This error wraps failures from either UpdateTableDisableChangeStream or UpdateTableWithChangeStream in Source.UpdateTable. The library wraps the underlying error with fmt.Errorf(\"failed to update table: %w\", err), preserving the original gRPC cause. It fires when toggling (disabling or enabling with a 24h retention) a table's change stream fails at the API level.","triggerScenarios":"Calling the bigtable update_table tool where s.Admin.UpdateTableDisableChangeStream(ctx, tableId) or s.Admin.UpdateTableWithChangeStream(ctx, tableId, 24*time.Hour) errors: table not found, change streams not supported on the table/instance type, invalid retention period, missing bigtable.tables.update permission, or transient gRPC failure.","commonSituations":"Toggling change streams on a table in an instance/region that does not support them or where the feature flag is unavailable in the installed client library version; wrong table ID; service account lacking update permission; retention conflicts with an existing stream.","solutions":["Verify the table ID exists and the installed cloud.google.com/go/bigtable version supports change stream admin APIs (upgrade the module if not).","Confirm the instance/region supports change streams and that the retention duration is acceptable to the API.","Grant roles/bigtable.admin (bigtable.tables.update) to the caller.","Retry transient gRPC failures with backoff; check status.Code(err) to distinguish NotFound/PermissionDenied/FailedPrecondition."],"exampleFix":"// before\nerr = s.Admin.UpdateTableWithChangeStream(ctx, tableId, 24*time.Hour)\n// after: check feature support / version before calling\nif changeStreamsUnsupported {\n    return nil, fmt.Errorf(\"change streams not supported for this instance/table\")\n}\nerr = s.Admin.UpdateTableWithChangeStream(ctx, tableId, 24*time.Hour)","handlingStrategy":"validation","validationCode":"// Go: verify support before toggling change streams\nif !changeStreamSupported { // check module version + instance/region capability\n    return fmt.Errorf(\"change streams not supported for this instance/table\")\n}\nif disableChangeStream == false && retention <= 0 {\n    return fmt.Errorf(\"retention duration must be positive\")\n}","typeGuard":"func isUnimplemented(err error) bool {\n    return status.Code(err) == codes.Unimplemented\n}","tryCatchPattern":"if err := src.UpdateTable(ctx, tableId, disableChangeStream); err != nil {\n    if status.Code(err) == codes.Unimplemented {\n        return fmt.Errorf(\"upgrade cloud.google.com/go/bigtable; change stream admin API unavailable\")\n    }\n    if status.Code(err) == codes.FailedPrecondition {\n        return fmt.Errorf(\"change streams unsupported or conflicting retention: %w\", err)\n    }\n    return fmt.Errorf(\"update table: %w\", err)\n}","preventionTips":["Pin/upgrade cloud.google.com/go/bigtable to a version with change stream admin APIs.","Confirm the region/instance supports change streams before toggling.","Validate retention windows against product limits (default here is 24h).","Retry only transient codes; surface Unimplemented as a version problem."],"tags":["gcp","bigtable","grpc","change-streams","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-08T10:18:20.063Z"}