{"record":{"id":"b8ce8d05ff464854","repo":"googleapis/mcp-toolbox","slug":"failed-to-create-column-family-w","errorCode":null,"errorMessage":"failed to create column family: %w","messagePattern":"failed to create column family: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/bigtable/admin_wrappers.go","lineNumber":146,"sourceCode":"\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) {\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}","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/bigtable/admin_wrappers.go#L128-L164","documentation":"This error wraps failures from the Bigtable Admin client's CreateColumnFamily call inside Source.CreateTable, raised only when a non-empty columnFamily argument is supplied. The library wraps the underlying error with fmt.Errorf(\"failed to create column family: %w\", err); the table itself was already created successfully at this point. The original gRPC cause is preserved in the chain.","triggerScenarios":"Calling the bigtable create_table tool with a columnFamily argument where s.Admin.CreateColumnFamily(ctx, tableId, columnFamily) errors: column family name contains invalid characters, the family already exists, permissions missing (bigtable.tables.update), or transient gRPC failure after the table was created.","commonSituations":"Using names with spaces or invalid characters for the family; re-running creation after the family already exists; partial-failure states where the table exists but the family step failed; IAM gaps on the service account.","solutions":["Use a valid column family name: letters, digits, underscores, hyphens, dots only (must match [_a-zA-Z0-9][-_.a-zA-Z0-9]*).","If the table now exists, add the column family via an update path instead of re-creating the table; treat ALREADY_EXISTS as success.","Grant roles/bigtable.admin so both create-table and create-family calls succeed.","Retry only the column family step on transient gRPC errors to avoid duplicating table creation."],"exampleFix":"// before: one-shot call that leaves a half-created table on family failure\nerr := s.Admin.CreateTable(ctx, tableId)\n// after: make the family step idempotent\nif err := s.Admin.CreateColumnFamily(ctx, tableId, cf); err != nil && status.Code(err) != codes.AlreadyExists {\n    return nil, fmt.Errorf(\"failed to create column family: %w\", err)\n}","handlingStrategy":"validation","validationCode":"// Go: validate column family name before CreateTable\nvar cfRe = regexp.MustCompile(`^[_a-zA-Z0-9][-_.a-zA-Z0-9]*$`)\nif columnFamily != \"\" && !cfRe.MatchString(columnFamily) {\n    return fmt.Errorf(\"invalid column family name: %q\", columnFamily)\n}","typeGuard":"func isCfAlreadyExists(err error) bool {\n    return status.Code(err) == codes.AlreadyExists\n}","tryCatchPattern":"if err := src.CreateTable(ctx, tableId, cf); err != nil {\n    if strings.Contains(err.Error(), \"failed to create column family\") &&\n        status.Code(errors.Unwrap(err)) == codes.AlreadyExists {\n        return nil // family already present\n    }\n    return fmt.Errorf(\"create table: %w\", err)\n}","preventionTips":["Restrict column family names to letters, digits, underscore, hyphen, dot.","Remember the table is already created when this error fires — recover by adding the family, not recreating the table.","Handle ALREADY_EXISTS on the family step as success for idempotency.","Keep the admin client version current; create-table-then-family needs both permissions."],"tags":["gcp","bigtable","grpc","iam","schema"],"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"}