{"record":{"id":"8857e902040a7b4e","repo":"gastownhall/beads","slug":"refusing-to-auto-commit-d-dirty-internal-config-k","errorCode":null,"errorMessage":"refusing to auto-commit %d dirty internal config key(s) before pull: %s; only user %s* keys auto-commit before a pull (GH#2455) — commit or revert these explicitly with `bd dolt commit` first","messagePattern":"refusing to auto-commit (.+?) dirty internal config key\\(s\\) before pull: (.+?); only user (.+?)\\* keys auto-commit before a pull \\(GH#2455\\) — commit or revert these explicitly with `bd dolt commit` first","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dolt/store.go","lineNumber":3203,"sourceCode":"\t\treturn fmt.Errorf(\"inspect dirty config before pull: %w\", err)\n\t}\n\tdefer rows.Close()\n\n\tvar unsafe []string\n\tfor rows.Next() {\n\t\tvar key sql.NullString\n\t\tif err := rows.Scan(&key); err != nil {\n\t\t\treturn fmt.Errorf(\"scan dirty config key: %w\", err)\n\t\t}\n\t\tif key.Valid && !strings.HasPrefix(key.String, kvkeys.Prefix) {\n\t\t\tunsafe = append(unsafe, key.String)\n\t\t}\n\t}\n\tif err := rows.Err(); err != nil {\n\t\treturn fmt.Errorf(\"iterate dirty config diff: %w\", err)\n\t}\n\tif len(unsafe) > 0 {\n\t\treturn fmt.Errorf(\"refusing to auto-commit %d dirty internal config key(s) before pull: %s; \"+\n\t\t\t\"only user %s* keys auto-commit before a pull (GH#2455) — commit or revert \"+\n\t\t\t\"these explicitly with `bd dolt commit` first\", len(unsafe), strings.Join(unsafe, \", \"), kvkeys.Prefix)\n\t}\n\treturn nil\n}\n\n// CommitWithConfig creates a Dolt commit that includes the config table.\n// Use this instead of Commit when the caller intentionally modified config\n// (e.g., CommitPending after 'bd config set', 'bd init', or 'bd rename-prefix').\n// GH#2455: Commit() excludes config to prevent sweeping up stale changes.\nfunc (s *DoltStore) CommitWithConfig(ctx context.Context, message string) error {\n\treturn s.withCircuitWrite(ctx, func(ctx context.Context) error {\n\t\tconn, err := s.db.Conn(ctx)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to acquire connection: %w\", err)\n\t\t}\n\t\tdefer conn.Close()\n","sourceCodeStart":3185,"sourceCodeEnd":3221,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dolt/store.go#L3185-L3221","documentation":"A guard error: before a pull, the store refuses to auto-commit because the working set contains dirty INTERNAL config keys (keys under the dolt-internal prefix, not user keys). Only user %s* keys are auto-committed before pull (GH#2455), to avoid sweeping up stale internal changes.","triggerScenarios":"Calling pull / sync (which pre-commits via this path) while internal config keys (e.g. set by `bd config set` on internal keys, init, or rename-prefix) are modified and uncommitted.","commonSituations":"A crashed or interrupted `bd config set`/`bd rename-prefix` left internal config rows dirty; parallel bd processes edited internal keys; manual SQL edits to the config table.","solutions":["Run `bd dolt commit` (or revert the internal keys) explicitly as the message instructs, then re-run the pull.","Use `bd dolt status` to list the offending internal keys.","Revert unwanted internal changes instead of committing them if they are stale."],"exampleFix":"// before\nbd sync  // fails: refusing to auto-commit 1 dirty internal config key(s)\n// after\nbd dolt commit -m \"commit internal config\"\nbd sync","handlingStrategy":"validation","validationCode":"// check for dirty internal keys before pull\nout, _ := exec.Command(\"bd\", \"dolt\", \"status\", \"--json\").Output()\nif strings.Contains(string(out), internalConfigPrefix) {\n    return errors.New(\"dirty internal config keys; run `bd dolt commit` first\")\n}","typeGuard":null,"tryCatchPattern":"if strings.Contains(err.Error(), \"refusing to auto-commit\") {\n    fmt.Fprintln(os.Stderr, \"run `bd dolt commit` (or revert) then retry the pull\")\n    return err\n}","preventionTips":["Always complete or revert `bd config set` / `bd rename-prefix` operations before syncing.","Avoid editing internal config keys via raw SQL.","Run `bd dolt status` before pull to catch dirty keys early.","Avoid running parallel bd commands that mutate config concurrently."],"tags":["dolt","config","dirty-working-set","pull","guard"],"backgroundTag":"dirty-config-key-blocks-pull","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}