{"record":{"id":"da4c14247529e320","repo":"gastownhall/beads","slug":"committing-migration-step-w","errorCode":null,"errorMessage":"committing migration step: %w","messagePattern":"committing migration step: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/schema/schema.go","lineNumber":1753,"sourceCode":"\tfor table := range dirtyAfter {\n\t\tif _, wasDirty := dirtyBeforeStep[table]; wasDirty {\n\t\t\tcontinue\n\t\t}\n\t\ttableSet[table] = struct{}{}\n\t}\n\ttables := make([]string, 0, len(tableSet))\n\tfor table := range tableSet {\n\t\ttables = append(tables, table)\n\t}\n\tsort.Strings(tables)\n\tfor _, table := range tables {\n\t\tif err := DrainCall(ctx, db, \"CALL DOLT_ADD('-f', ?)\", table); err != nil {\n\t\t\treturn fmt.Errorf(\"dolt add %s: %w\", table, err)\n\t\t}\n\t}\n\tif err := DrainCall(ctx, db, \"CALL DOLT_COMMIT('-m', ?)\", \"schema: apply migration \"+migrationName); err != nil {\n\t\tif !strings.Contains(strings.ToLower(err.Error()), \"nothing to commit\") {\n\t\t\treturn fmt.Errorf(\"committing migration step: %w\", err)\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":1735,"sourceCodeEnd":1758,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/schema/schema.go#L1735-L1758","documentation":"This error is returned when `CALL DOLT_COMMIT('-m', ?)` fails while committing a migration step (internal/storage/schema/schema.go:1753). The code deliberately tolerates a 'nothing to commit' result (an idempotent no-op migration) but any other commit error aborts the pass. It means the migration's changes and cursor row are staged but not durably committed to Dolt history.","triggerScenarios":"DOLT_COMMIT fails during commitMigrationStep with an error other than 'nothing to commit': Dolt merge/working-set conflicts, an author identity or commit environment problem, storage write failure (disk full, permissions), or internal Dolt state errors on the embedded path.","commonSituations":"Disk full while Dolt writes the commit; corrupted working set after a crash; .beads directory permissions changed (read-only mount); concurrent access corrupting the working set; an old/incompatible embedded Dolt engine version rejecting the commit.","solutions":["Read the wrapped inner error to identify the actual DOLT_COMMIT failure cause.","Check disk space and write permissions on the .beads directory; free space or fix the mount and retry.","Run `bd doctor` to detect and repair working-set/database corruption.","Ensure no concurrent `bd`/Dolt processes touch the database; kill stale processes and retry the migration pass.","If Dolt history/working set is corrupted, restore the .beads database from backup and re-run migrations."],"exampleFix":"// before: commit fails silently blocked by full disk\n# committing migration step: write .dolt/noms: no space left on device\n// after: free space (or relocate the data dir), verify, retry\ndf -h .beads\nbd doctor\nbd migrate up","handlingStrategy":"retry","validationCode":"// Check storage headroom and writability before a committing migration pass\nif info, err := os.Statfs(\".beads\"); err == nil && info.Bavail*uint64(info.Bsize) < minFreeBytes {\n    return fmt.Errorf(\"insufficient disk space for migration commits\")\n}\nif f, err := os.Create(\".beads/.write-test\"); err != nil {\n    return fmt.Errorf(\".beads not writable: %w\", err)\n} else { f.Close(); os.Remove(\".beads/.write-test\") }","typeGuard":null,"tryCatchPattern":"if err := runMigrations(ctx, db, src, min, 0, true); err != nil {\n    if strings.Contains(err.Error(), \"committing migration step: \") &&\n       !strings.Contains(strings.ToLower(err.Error()), \"nothing to commit\") {\n        // real DOLT_COMMIT failure: free disk / repair via bd doctor,\n        // then retry — per-step design makes retries converge\n        if fixErr := repairAndVerify(ctx); fixErr != nil { return fixErr }\n        return runMigrations(ctx, db, src, min, 0, true)\n    }\n    return err\n}","preventionTips":["Ensure ample free disk space before running migrations.","Keep .beads on a writable, non-read-only mount.","Run a single bd process per database to avoid working-set races.","Run bd doctor after crashes to catch torn commit state early.","Back up the .beads directory before version upgrades."],"tags":["database","dolt","commit","migration","disk"],"backgroundTag":"dolt-commit-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}