{"record":{"id":"e41522c5b37c3c22","repo":"gastownhall/beads","slug":"staging-seeded-dolt-ignore-patterns-w","errorCode":null,"errorMessage":"staging seeded dolt_ignore patterns: %w","messagePattern":"staging seeded dolt_ignore patterns: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/schema/schema.go","lineNumber":458,"sourceCode":"\t\t}\n\t\t// A RowsAffected error degrades to changed=false for that row: the\n\t\t// seed then stays an uncommitted working-set diff swept up by the\n\t\t// next commit, exactly the pre-scoped-commit behavior.\n\t\tif n, raErr := res.RowsAffected(); raErr == nil && n > 0 {\n\t\t\tchanged = true\n\t\t}\n\t}\n\treturn changed, nil\n}\n\n// commitSeededDoltIgnore stages and commits freshly seeded dolt_ignore rows\n// in a scoped, labeled commit. Both MigrateUp paths use it: on the no-work\n// short-circuit nothing downstream would ever commit the seed, and on the\n// migration path the seed must be committed before the first step so an\n// interrupted pass leaves a clean working set (#4566 self-heal contract).\nfunc commitSeededDoltIgnore(ctx context.Context, db DBConn) error {\n\tif err := DrainCall(ctx, db, \"CALL DOLT_ADD('dolt_ignore')\"); err != nil {\n\t\treturn fmt.Errorf(\"staging seeded dolt_ignore patterns: %w\", err)\n\t}\n\tif err := DrainCall(ctx, db, \"CALL DOLT_COMMIT('-m', 'schema: seed dolt_ignore patterns')\"); err != nil {\n\t\treturn fmt.Errorf(\"committing seeded dolt_ignore patterns: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc LatestVersion() int {\n\tlatestOnce.Do(func() {\n\t\tlatestVer = mainSource.latest()\n\t})\n\treturn latestVer\n}\n\nfunc LatestIgnoredVersion() int {\n\tlatestIgnoredOnce.Do(func() {\n\t\tlatestIgnoredVer = ignoredSource.latest()\n\t})","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/schema/schema.go#L440-L476","documentation":"This error wraps a failure of `CALL DOLT_ADD('dolt_ignore')` when committing freshly seeded dolt_ignore patterns during MigrateUp. The seed must be staged and committed as a scoped, labeled commit so an interrupted migration pass leaves a clean working set (#4566 self-heal contract); failing at the DOLT_ADD step means the seed rows stay dirty.","triggerScenarios":"MigrateUp (both no-work short-circuit and migration paths) calling commitSeededDoltIgnore when the Dolt working set or server refuses DOLT_ADD — e.g. merge conflict state, server not accepting stored-procedure calls, or a read-only store.","commonSituations":"Repo in a conflicted/detached Dolt state; Dolt server freshly auto-started and rejecting procedure calls; running migrations where the dolt_ignore table is in an unexpected staged state.","solutions":["Inspect the wrapped DOLT_ADD error; run `dolt status` to see the working-set state","Resolve any conflicts or dirty staged state, then re-run migrations","Confirm the database is opened read-write and the Dolt server is healthy","Retry MigrateUp — seeding and staging are idempotent"],"exampleFix":"// before: dirty working set blocks DOLT_ADD\ndolt status // shows conflicts\n// after: clean the working set first\ndolt checkout . && bd migrate","handlingStrategy":"try-catch","validationCode":"// ensure a clean working set before migrations that stage dolt_ignore\nrows, err := db.QueryContext(ctx, \"CALL DOLT_STATUS()\")\nif err != nil { return err }\nfor rows.Next() { /* any non-empty dirty state -> resolve first */ }","typeGuard":null,"tryCatchPattern":"if err := commitSeededDoltIgnore(ctx, db); err != nil {\n\tif strings.Contains(err.Error(), \"staging seeded dolt_ignore\") {\n\t\t// DOLT_ADD failed: inspect DOLT_STATUS, resolve conflicts, retry\n\t}\n}","preventionTips":["Resolve conflicts and clean the working set before running bd migrate","Confirm Dolt stored-procedure calls (CALL DOLT_ADD) work against the server","Use the locked migration path to avoid concurrent writers"],"tags":["dolt","migration","dolt-ignore","staging"],"backgroundTag":"dolt-add-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}