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 commit

View on GitHub (pinned to 71377f2769)

Solutions

  1. Retry once connectivity is restored; this is a read-only check.
  2. Run `bd dolt status` manually to confirm the database is queryable.
  3. Inspect the wrapped cause (%w) for the specific SQL error (permissions, missing dolt_ignore table).
  4. 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

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.