{"record":{"id":"2449e6d46f7d2597","repo":"googleapis/mcp-toolbox","slug":"error-processing-row-w","errorCode":null,"errorMessage":"error processing row: %w","messagePattern":"error processing row: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/bigtable/bigtable.go","lineNumber":211,"sourceCode":"\n\t\tfor _, c := range cols {\n\t\t\tvar columValue any\n\t\t\tif err = resultRow.GetByName(c.Name, &columValue); err != nil {\n\t\t\t\trowErr = err\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tvMap[c.Name] = columValue\n\t\t}\n\n\t\tout = append(out, vMap)\n\n\t\treturn true\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to execute client: %w\", err)\n\t}\n\tif rowErr != nil {\n\t\treturn nil, fmt.Errorf(\"error processing row: %w\", rowErr)\n\t}\n\n\treturn out, nil\n}\n\nfunc initBigtableClient(ctx context.Context, tracer trace.Tracer, name, project, instance string) (*bigtable.Client, error) {\n\t//nolint:all // Reassigned ctx\n\tctx, span := sources.InitConnectionSpan(ctx, tracer, SourceType, name)\n\tdefer span.End()\n\n\t// Set up Bigtable data operations client.\n\tpoolSize := 10\n\tuserAgent, err := util.UserAgentFromContext(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient, err := bigtable.NewClient(ctx, project, instance, option.WithUserAgent(userAgent), option.WithGRPCConnectionPool(poolSize))","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/bigtable/bigtable.go#L193-L229","documentation":"Inside the Execute row callback, resultRow.GetByName(c.Name, &columValue) failed while decoding a column value into a generic any. This indicates a row-level deserialization problem — e.g. a column value whose type can't be scanned into the destination — rather than a query or network failure. The callback stores the error in rowErr and stops iteration; RunSQL then reports it wrapped with this message.","triggerScenarios":"During bs.Execute, the per-row callback calls resultRow.GetByName for each column in resultRow.Metadata.Columns; GetByName returns an error for that specific row/column, callback sets rowErr and returns false.","commonSituations":"Columns with Bigtable value types the generic decoding path can't handle (bytes/complex cells); schema changed so column types differ from expectations; nil/empty cells being scanned unexpectedly.","solutions":["Read the wrapped GetByName error to identify the failing column and value type","Scan the column into the specific Go type matching the column's SQL type instead of a generic any","Skip/handle problematic columns defensively in the callback and continue processing remaining rows","Check for recent schema/value-format changes on the table or column family"],"exampleFix":"// before\nvar columValue any\nif err = resultRow.GetByName(c.Name, &columValue); err != nil { ... }\n// after (scan into concrete type, e.g. string)\nvar columValue string\nif err = resultRow.GetByName(c.Name, &columValue); err != nil { ... }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"out, err := src.RunSQL(ctx, stmt, cfgParams, values)\nif err != nil {\n\tif strings.Contains(err.Error(), \"error processing row\") {\n\t\t// row-level decode failure: inspect wrapped GetByName error,\n\t\t// log the offending column, and fall back to a narrower query\n\t\tlog.Printf(\"row decode failed: %v\", err)\n\t}\n\treturn err\n}","preventionTips":["Scan columns into concrete Go types matching the column's SQL type instead of a generic any","Keep table value formats stable; coordinate schema changes with tool consumers","Test tools against tables with all column types they will encounter","Handle problematic columns defensively (skip or convert) so one bad cell doesn't kill the result set"],"tags":["bigtable","row-processing","deserialization"],"backgroundTag":"row-deserialization-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"}