{"record":{"id":"b22355d3f47b96cb","repo":"gastownhall/beads","slug":"dolt-commit-w-b22355","errorCode":null,"errorMessage":"dolt commit: %w","messagePattern":"dolt commit: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dolt/sweeper.go","lineNumber":82,"sourceCode":"\t\t\treturn issueops.SweepResult{}, err\n\t\t}\n\t\treturn result, nil\n\t}\n\n\tif err := s.store.withWriteTx(ctx, func(tx *sql.Tx) error {\n\t\tif err := run(tx); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif result.Swept == 0 {\n\t\t\treturn nil\n\t\t}\n\t\tfor _, table := range sweptTables {\n\t\t\t_ = schema.DrainCall(ctx, tx, \"CALL DOLT_ADD(?)\", table)\n\t\t}\n\t\tmsg := fmt.Sprintf(\"bd: sweep %d %s bead(s)\", result.Swept, req.Tier)\n\t\tif err := schema.DrainCall(ctx, tx, \"CALL DOLT_COMMIT('-m', ?, '--author', ?)\",\n\t\t\tmsg, s.store.commitAuthorString()); err != nil && !isDoltNothingToCommit(err) {\n\t\t\treturn fmt.Errorf(\"dolt commit: %w\", err)\n\t\t}\n\t\treturn nil\n\t}); err != nil {\n\t\treturn issueops.SweepResult{}, err\n\t}\n\treturn result, nil\n}\n\n// sweptTables are the versioned tables a sweep can touch, staged before the\n// commit. It is the same list DeleteIssues stages, because a sweep IS a\n// delete of a selected set.\nvar sweptTables = []string{\n\t\"issues\", \"dependencies\", \"labels\", \"comments\", \"events\", \"provenance_events\",\n\t\"child_counters\", \"issue_snapshots\", \"compaction_snapshots\",\n}\n","sourceCodeStart":64,"sourceCodeEnd":98,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dolt/sweeper.go#L64-L98","documentation":"During a sweep, the store stages swept tables with DOLT_ADD and commits with DOLT_COMMIT('-m', ..., '--author', ...). This error wraps a dolt commit failure inside the sweep transaction, except when the failure is merely 'nothing to commit' (isDoltNothingToCommit suppresses it). Any other commit error aborts the sweep transaction.","triggerScenarios":"Calling the sweep operation when DOLT_COMMIT fails for a real reason: merge/commit conflicts on the working set, the sweep transaction's session state invalidating the commit, an invalid author string, the Dolt working set locked by another process, or tables failing to stage so the commit errors.","commonSituations":"Concurrent writers to the same database causing working-set conflicts; sweep running on a database whose dolt workspace is in a conflicted state after a failed merge; a --dolt_workspace or lock leftover from a crashed process; malformed commitAuthorString.","solutions":["Inspect the underlying wrapped error — run `dolt status` and resolve any merge conflicts in the working set.","Check for stale Dolt working-set locks (from crashed processes) and clear them.","Retry the sweep; 'nothing to commit' cases are already handled as success.","Verify commitAuthorString produces a valid author (Name <email>).","Ensure no other bd process is committing concurrently to the same database."],"exampleFix":"// before\nif err := schema.DrainCall(ctx, tx, \"CALL DOLT_COMMIT('-m', ?, '--author', ?)\", msg, author); err != nil && !isDoltNothingToCommit(err) {\n    return fmt.Errorf(\"dolt commit: %w\", err)\n}\n// after\nif err := schema.DrainCall(ctx, tx, \"CALL DOLT_COMMIT('-m', ?, '--author', ?)\", msg, author); err != nil {\n    if isDoltNothingToCommit(err) { return nil }\n    if isDoltWorkingSetConflict(err) { return retryableSweepError{cause: err} }\n    return fmt.Errorf(\"dolt commit: %w\", err)\n}","handlingStrategy":"retry","validationCode":"// before sweeping: ensure working set is clean and no other writer holds it\nst, err := store.Status(ctx)\nif err != nil { return err }\n// conflicted working sets will break DOLT_COMMIT\nif strings.Contains(fmt.Sprint(st), \"conflict\") { return errors.New(\"resolve conflicts before sweep\") }","typeGuard":null,"tryCatchPattern":"result, err := sweeper.Sweep(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"dolt commit:\") {\n    if strings.Contains(err.Error(), \"working set\") || strings.Contains(err.Error(), \"conflict\") {\n        // transient/lock: retry after clearing dolt working-set locks\n        return sweeper.Sweep(ctx, req)\n    }\n    return err\n}","preventionTips":["Pre-check dolt status for conflicts before running sweeps","Serialize sweeps with other writers (single sweeper per database)","Validate the commit author string format before commits","Clean stale dolt working-set locks after crashed processes","Keep the isDoltNothingToCommit suppression so empty sweeps don't false-fail"],"tags":["dolt","commit","sweeper","transaction"],"backgroundTag":"dolt-commit-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}