{"record":{"id":"e7eff079ac1217a9","repo":"gastownhall/beads","slug":"dolt-commit-w-e7eff0","errorCode":null,"errorMessage":"dolt commit: %w","messagePattern":"dolt commit: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/versioncontrolops/commit.go","lineNumber":99,"sourceCode":"\t// dirty-tracked tables. When those specific tables turn out clean (idempotent\n\t// no-op) while some UNRELATED table is concurrently dirty, the fast-path does\n\t// not fire yet staging stages nothing — so DOLT_COMMIT('-m') would still emit\n\t// the \"nothing to commit\" warning. Check the STAGED set (exactly what '-m'\n\t// will commit) and skip the empty commit.\n\tstaged, err := issueops.HasStagedChanges(ctx, conn)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"check staged changes before commit: %w\", err)\n\t}\n\tif !staged {\n\t\treturn nil\n\t}\n\tif author == \"\" {\n\t\t_, err = conn.ExecContext(ctx, \"CALL DOLT_COMMIT('-m', ?)\", commitMsg)\n\t} else {\n\t\t_, err = conn.ExecContext(ctx, \"CALL DOLT_COMMIT('-m', ?, '--author', ?)\", commitMsg, author)\n\t}\n\tif err != nil && !issueops.IsNothingToCommitError(err) {\n\t\treturn fmt.Errorf(\"dolt commit: %w\", err)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":81,"sourceCodeEnd":104,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/versioncontrolops/commit.go#L81-L104","documentation":"The final DOLT_COMMIT('-m'[, '--author', ?]) failure is wrapped as 'dolt commit: %w' — but only when the error is NOT a 'nothing to commit' condition (issueops.IsNothingToCommitError filters those out and returns nil). So this error represents a genuine commit failure: merge conflicts, identity misconfiguration, or connection problems.","triggerScenarios":"Calling StageAndCommit when DOLT_COMMIT fails for reasons other than an empty staged set: unresolved merge conflicts, missing/invalid user.name/user.email for the --author path, lock or connection errors.","commonSituations":"Dolt identity not configured (user.email/user.name unset); committing on top of an unresolved merge; concurrent sessions contending for the working set; server restart mid-commit.","solutions":["Configure Dolt identity (CALL DOLT_CONFIG('--global', 'user.email', ...) and user.name) or pass a valid author","Check the wrapped error for merge-conflict state and resolve conflicts (dolt conflicts / DOLT_CONFLICTS) before retrying","Reconnect after connection failures and re-run StageAndCommit (idempotent thanks to the pending/staged checks)","Inspect the underlying driver error message for the precise Dolt failure code"],"exampleFix":"// before\nerr := versioncontrolops.StageAndCommit(ctx, conn, tables, msg, \"\")\n// after\n_, _ = conn.ExecContext(ctx, \"CALL DOLT_CONFIG('--global', 'user.email', 'ops@example.com')\")\n_, _ = conn.ExecContext(ctx, \"CALL DOLT_CONFIG('--global', 'user.name', 'ops')\")\nerr := versioncontrolops.StageAndCommit(ctx, conn, tables, msg, \"ops <ops@example.com>\")","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := versioncontrolops.StageAndCommit(ctx, conn, tables, msg, author)\nif err != nil && strings.Contains(err.Error(), \"dolt commit\") {\n    switch {\n    case strings.Contains(err.Error(), \"user.email\") || strings.Contains(err.Error(), \"identity\"):\n        configureDoltIdentity(ctx, conn) // DOLT_CONFIG user.email/user.name, then retry\n    case strings.Contains(err.Error(), \"conflict\"):\n        resolveConflicts(ctx, conn) // dolt conflicts resolve, re-add, retry\n    default:\n        return fmt.Errorf(\"commit failed: %w\", err)\n    }\n}","preventionTips":["Configure Dolt user.email/user.name (globally or per session) before first commit","Pass a well-formed author string ('Name <email>') when using the author path","Resolve all merge conflicts before committing","Reconnect and retry on transient connection failures — the checks make it safe"],"tags":["dolt","sql","commit"],"backgroundTag":"dolt-commit-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}