{"record":{"id":"869a28714917e73d","repo":"gastownhall/beads","slug":"dolt-commit-after-sql-mutation-w-w","errorCode":null,"errorMessage":"dolt commit after SQL mutation: %w: %w","messagePattern":"dolt commit after SQL mutation: %w: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/storage/dolt/store.go","lineNumber":3320,"sourceCode":"\t\t// Skip the commit when nothing was actually staged (idempotent no-op\n\t\t// write), so Dolt does not log a server-side \"nothing to commit\" warning\n\t\t// on every reconcile-cadence call. The guard tests the STAGED set rather\n\t\t// than the whole working set because this helper stages only a fixed\n\t\t// table list — an unrelated dirty table must not trigger an empty '-m'\n\t\t// commit. A guard-read failure is NOT a publication failure: nothing has\n\t\t// been committed and nothing is indeterminate, so plain error return.\n\t\tstaged, err := issueops.HasStagedChanges(ctx, conn)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"check staged changes before commit: %w\", err)\n\t\t}\n\t\tif !staged {\n\t\t\treturn nil\n\t\t}\n\n\t\tif err := schema.DrainCall(ctx, conn, \"CALL DOLT_COMMIT('-m', ?, '--author', ?)\",\n\t\t\tcommitMsg, s.commitAuthorString()); err != nil && !isDoltNothingToCommit(err) {\n\t\t\treturn s.recordDoltPublicationFailure(ctx,\n\t\t\t\tfmt.Errorf(\"dolt commit after SQL mutation: %w: %w\", err, ErrCommitIndeterminate))\n\t\t}\n\t\treturn nil\n\t})\n}\n\nfunc (s *DoltStore) wrapDoltPublicationFailure(ctx context.Context, op string, err error) error {\n\treturn s.recordDoltPublicationFailure(ctx, wrapSQLCommitError(op, err))\n}\n\n// recordDoltPublicationFailure accounts once for an ambiguous connection loss\n// at a Dolt publication boundary. Direct publication helpers stay outside\n// withRetryTx; transaction-backed writes call this from withRetryTx itself.\nfunc (s *DoltStore) recordDoltPublicationFailure(ctx context.Context, err error) error {\n\tif s.breaker == nil || !errors.Is(err, ErrCommitIndeterminate) || !isConnectionError(err) {\n\t\treturn err\n\t}\n\ts.breaker.RecordFailure()\n\tif s.breaker.State() == circuitOpen {","sourceCodeStart":3302,"sourceCodeEnd":3338,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dolt/store.go#L3302-L3338","documentation":"CALL DOLT_COMMIT failed after staging tables following a SQL mutation. Wrapped with ErrCommitIndeterminate because the mutation already succeeded — the commit may or may not have landed, so it must not be replayed blindly. 'nothing to commit' responses are intentionally tolerated and not an error.","triggerScenarios":"doltAddAndCommit staged the tables (guard saw staged changes) and DOLT_COMMIT('-m', ...) returns a real error — server drop, merge conflict, or commit hook failure.","commonSituations":"Dolt server crash between add and commit; another writer committed conflicting changes creating a conflict; network partition to a server-mode Dolt.","solutions":["Check `bd dolt log` / `bd dolt status` to determine whether the commit landed before doing anything else.","If it landed, no action needed. If not and the working set is intact, re-run the operation to publish.","Resolve any conflicts shown by dolt status, then re-commit.","Record/review server logs for the failure cause."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before re-running: did the commit land?\nout, _ := exec.Command(\"bd\", \"dolt\", \"log\", \"-n\", \"1\", \"--json\").Output()\n// compare HEAD message/author against the intended commitMsg before retrying","typeGuard":null,"tryCatchPattern":"if errors.Is(err, ErrCommitIndeterminate) {\n    // check `bd dolt log` / `bd dolt status`: commit may have landed\n    // do NOT replay the mutation/commit blindly\n}","preventionTips":["Never replay ErrCommitIndeterminate commits without verifying dolt log.","Resolve working-set conflicts before commit-heavy operations.","Use a stable server-mode Dolt deployment for concurrent agents.","Alert on commit failures so they are investigated promptly."],"tags":["dolt","commit","indeterminate-commit","database"],"backgroundTag":"commit-indeterminate","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}