gastownhall/beads · error

ErrExec

ErrExec

Error message

exec error

What it means

ErrExec is the sentinel error for a failed database exec (INSERT/UPDATE/DELETE) in the Dolt storage layer. It is produced by wrapExecError, which translates low-level SQL driver failures into this classified sentinel so callers can branch on it via errors.Is. It signals that a write statement against the Dolt database did not succeed.

Source

Thrown at internal/storage/dolt/errors.go:31

	"github.com/steveyegge/beads/internal/storage"
	"github.com/steveyegge/beads/internal/storage/dberrors"
)

// Sentinel errors for the dolt storage layer.
// These complement the storage-level sentinels (storage.ErrNotFound, etc.)
// with dolt-specific error types.
var (
	// ErrTransaction indicates a transaction begin/commit/rollback failure.
	ErrTransaction = errors.New("transaction error")

	// ErrQuery indicates a database query failure.
	ErrQuery = errors.New("query error")

	// ErrScan indicates a failure scanning database rows into Go values.
	ErrScan = errors.New("scan error")

	// ErrExec indicates a database exec (INSERT/UPDATE/DELETE) failure.
	ErrExec = errors.New("exec error")

	// ErrDanglingReference indicates that the pre-push integrity check detected
	// missing chunks in the local Dolt noms store. The push was aborted to
	// prevent propagating the corruption to the remote. Run bd dolt verify
	// to diagnose and recover.
	ErrDanglingReference = errors.New("dangling chunk reference")

	// ErrFSCKTimeout indicates that the pre-push integrity check (dolt fsck) did
	// not complete within the configured timeout. The push was aborted without
	// verifying chunk integrity — the store is not necessarily corrupt. Large
	// stores can be shrunk with `dolt gc` (or `CALL DOLT_GC()` on a running
	// sql-server); the timeout can be raised via the BEADS_FSCK_TIMEOUT
	// environment variable.
	ErrFSCKTimeout = errors.New("pre-push integrity check timed out")

	// ErrCommitIndeterminate is the storage-wide no-replay sentinel. Keep this
	// alias for server-Dolt callers while embedded Dolt returns the same value.
	ErrCommitIndeterminate = storage.ErrCommitIndeterminate

View on GitHub (pinned to 71377f2769)

Solutions

  1. Check the wrapped underlying error for the root cause (errors.Unwrap / %w chain).
  2. Verify the Dolt server is running and reachable (bd dolt status / server process).
  3. Run bd doctor to diagnose storage health.
  4. If schema-related, re-run migrations or bd bootstrap to repair the database.

Example fix

// before
if err := store.InsertIssue(ctx, iss); err != nil {
    log.Fatal(err)
}
// after
if err := store.InsertIssue(ctx, iss); err != nil {
    if errors.Is(err, dolt.ErrExec) {
        log.Fatalf("write failed: %v — check dolt sql-server health", err)
    }
    log.Fatal(err)
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Go has no pre-call check; verify server reachability first
if err := db.PingContext(ctx); err != nil { /* server down */ }

Try / catch

if err := store.InsertIssue(ctx, iss); err != nil {
    if errors.Is(err, dolt.ErrExec) {
        // handle write failure: inspect %w chain, retry or report
    }
}

Prevention

When it happens

Trigger: Any SQL write path (issue insert/update/delete, dependency writes) fails at the driver level — connection loss, syntax/schema mismatch, constraint violation, or server unavailability — and wrapExecError classifies it as ErrExec.

Common situations: Dolt sql-server restarted or was reaped mid-write; autocommit disabled writes never committed; schema drift after upgrading beads; disk-full or permissions issues on the server host.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/6792b1e339b8c64b. Report an issue: GitHub.