{"record":{"id":"9cd1e2f67d26bd0d","repo":"gastownhall/beads","slug":"failed-to-check-status-w","errorCode":null,"errorMessage":"failed to check status: %w","messagePattern":"failed to check status: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dolt/store.go","lineNumber":3358,"sourceCode":"\t\treturn fmt.Errorf(\"%w (circuit breaker tripped)\", err)\n\t}\n\treturn err\n}\n\n// HasCommittablePending reports whether the working set holds committable\n// changes, excluding dolt_ignore'd tables (wisp and lease tables appear in\n// dolt_status but can't be staged). Implements storage.PendingChangeDetector.\nfunc (s *DoltStore) HasCommittablePending(ctx context.Context) (bool, error) {\n\tvar count int\n\terr := s.db.QueryRowContext(ctx, `\n\t\tSELECT COUNT(*) FROM dolt_status s\n\t\tWHERE NOT EXISTS (\n\t\t\tSELECT 1 FROM dolt_ignore di\n\t\t\tWHERE di.ignored = 1\n\t\t\tAND s.table_name LIKE di.pattern\n\t\t)`).Scan(&count)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to check status: %w\", err)\n\t}\n\treturn count > 0, nil\n}\n\n// CommitPending creates a single Dolt commit for all uncommitted changes in the working set.\n// Returns (true, nil) if changes were committed, (false, nil) if there was nothing to commit,\n// or (false, err) on failure. The commit message summarizes the accumulated changes by\n// querying dolt_diff to count issue-level operations.\n//\n// This is the primary commit mechanism for batch mode, where multiple bd commands\n// accumulate changes in the working set before committing at a logical boundary.\nfunc (s *DoltStore) CommitPending(ctx context.Context, actor string) (bool, error) {\n\tdirty, err := s.HasCommittablePending(ctx)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif !dirty {\n\t\treturn false, nil // Nothing to commit","sourceCodeStart":3340,"sourceCodeEnd":3376,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dolt/store.go#L3340-L3376","documentation":"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.","triggerScenarios":"The counting query against dolt_status/dolt_ignore (filtering ignored wisp and lease tables) errors — connection failure, permissions, or unexpected schema state.","commonSituations":"Dolt server unavailable; dolt_ignore table corrupted or modified by hand; permission changes on the database.","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."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if err := s.db.PingContext(ctx); err != nil {\n    return fmt.Errorf(\"database unavailable before status check: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if strings.Contains(err.Error(), \"failed to check status\") {\n    // read-only failure: safe to retry after backoff\n}","preventionTips":["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."],"tags":["dolt","status","dolt-ignore","database"],"backgroundTag":"dolt-status-check-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}