gastownhall/beads · error
failed to check status: %w
Error message
failed to check status: %w
What it means
HasCommittablePending failed while running its status-count query (counting working-set tables not covered by dolt_ignore). It cannot report whether committable changes exist, so it returns the wrapped error instead of a boolean.
Source
Thrown at internal/storage/dolt/store.go:3358
return fmt.Errorf("%w (circuit breaker tripped)", err)
}
return err
}
// HasCommittablePending reports whether the working set holds committable
// changes, excluding dolt_ignore'd tables (wisp and lease tables appear in
// dolt_status but can't be staged). Implements storage.PendingChangeDetector.
func (s *DoltStore) HasCommittablePending(ctx context.Context) (bool, error) {
var count int
err := s.db.QueryRowContext(ctx, `
SELECT COUNT(*) FROM dolt_status s
WHERE NOT EXISTS (
SELECT 1 FROM dolt_ignore di
WHERE di.ignored = 1
AND s.table_name LIKE di.pattern
)`).Scan(&count)
if err != nil {
return false, fmt.Errorf("failed to check status: %w", err)
}
return count > 0, nil
}
// CommitPending creates a single Dolt commit for all uncommitted changes in the working set.
// Returns (true, nil) if changes were committed, (false, nil) if there was nothing to commit,
// or (false, err) on failure. The commit message summarizes the accumulated changes by
// querying dolt_diff to count issue-level operations.
//
// This is the primary commit mechanism for batch mode, where multiple bd commands
// accumulate changes in the working set before committing at a logical boundary.
func (s *DoltStore) CommitPending(ctx context.Context, actor string) (bool, error) {
dirty, err := s.HasCommittablePending(ctx)
if err != nil {
return false, err
}
if !dirty {
return false, nil // Nothing to commitView on GitHub (pinned to 71377f2769)
Solutions
- Retry once connectivity is restored; this is a read-only check.
- Run `bd dolt status` manually to confirm the database is queryable.
- Inspect the wrapped cause (%w) for the specific SQL error (permissions, missing dolt_ignore table).
- Restore dolt_ignore contents if it was modified or dropped.
Defensive patterns
Strategy: retry
Validate before calling
if err := s.db.PingContext(ctx); err != nil {
return fmt.Errorf("database unavailable before status check: %w", err)
} Try / catch
if strings.Contains(err.Error(), "failed to check status") {
// read-only failure: safe to retry after backoff
} Prevention
- Never hand-edit or drop the dolt_ignore table.
- Ensure the DB user retains read access to dolt_status and dolt_ignore.
- Retry read-only checks with backoff for transient server errors.
- Run bd doctor after version upgrades to catch schema drift.
When it happens
Trigger: The counting query against dolt_status/dolt_ignore (filtering ignored wisp and lease tables) errors — connection failure, permissions, or unexpected schema state.
Common situations: Dolt server unavailable; dolt_ignore table corrupted or modified by hand; permission changes on the database.
Related errors
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/9cd1e2f67d26bd0d.
Report an issue: GitHub.