{"record":{"id":"d01a91065ae8eb76","repo":"gastownhall/beads","slug":"failed-to-scan-dolt-status-w","errorCode":null,"errorMessage":"failed to scan dolt_status: %w","messagePattern":"failed to scan dolt_status: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dolt/store.go","lineNumber":3073,"sourceCode":"\t// keeps ordinary commits from failing whenever an ignored table is dirty.\n\trows, err := conn.QueryContext(ctx, `\n\t\tSELECT s.table_name FROM dolt_status s\n\t\tWHERE NOT EXISTS (\n\t\t\tSELECT 1 FROM dolt_ignore di\n\t\t\tWHERE di.ignored = 1\n\t\t\tAND s.table_name LIKE di.pattern\n\t\t)`)\n\tif err != nil {\n\t\t// If dolt_status fails, fall back to nothing (rare edge case).\n\t\treturn fmt.Errorf(\"failed to query dolt_status: %w\", err)\n\t}\n\tvar tables []string\n\tconfigDirty := false\n\tfor rows.Next() {\n\t\tvar table string\n\t\tif err := rows.Scan(&table); err != nil {\n\t\t\t_ = rows.Close()\n\t\t\treturn fmt.Errorf(\"failed to scan dolt_status: %w\", err)\n\t\t}\n\t\tif table == \"config\" {\n\t\t\tconfigDirty = true\n\t\t\tif mode == configExclude {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\ttables = append(tables, table)\n\t}\n\t_ = rows.Close()\n\tif err := rows.Err(); err != nil {\n\t\treturn fmt.Errorf(\"failed to iterate dolt_status: %w\", err)\n\t}\n\n\t// GH#2455 + GH#2474: the pre-pull auto-commit includes config so user kv.*\n\t// writes sync, but it must NOT auto-commit any internal (non-kv.) config key.\n\t// Refuse before staging anything so the merge is never concluded over an\n\t// unsafe config row; the operator commits those explicitly.","sourceCodeStart":3055,"sourceCodeEnd":3091,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dolt/store.go#L3055-L3091","documentation":"While iterating dolt_status rows, each row is scanned into a single table-name string. This error wraps a rows.Scan failure, meaning the row shape did not match expectations (one string column). Scanning is aborted, rows are closed, and the commit is aborted before staging.","triggerScenarios":"dolt_status returns rows whose columns cannot scan into a string — typically a driver/type mismatch (e.g. unexpected NULL or a Dolt version returning extra/differently-typed columns such as a staged flag or error text).","commonSituations":"Dolt engine upgrade changing the dolt_status column layout; a table name containing data that a custom scanner chokes on; binary/driver version skew between the Go driver and the Dolt server.","solutions":["Check the wrapped error text for the offending column/type; align the Dolt driver and server versions.","Upgrade or pin the go-mysql-driver/dolt version pair so dolt_status's schema matches what store.go expects.","Run a manual SELECT * FROM dolt_status in a Dolt SQL shell to inspect actual column shape.","Retry after version alignment; the failure occurs pre-staging, so no cleanup is needed."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// verify dolt_status column shape on your engine\nrows, _ := conn.QueryContext(ctx, \"SELECT table_name FROM dolt_status LIMIT 1\")\nif rows != nil { cols, _ := rows.Columns(); _ = cols /* expect single string col */ }","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"failed to scan dolt_status\") {\n\t// treat as engine/driver version mismatch; upgrade and retry\n}","preventionTips":["Pin matched go-mysql-driver and Dolt server versions in CI.","Test commits against dolt_status after engine upgrades.","Run SELECT * FROM dolt_status manually when upgrading.","Report/inspect unexpected NULL or extra columns before committing."],"tags":["go","dolt","sql","scan","version-compat"],"backgroundTag":"dolt-status-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}