fix(handlers): log DB Scan/Exec errors previously silently ignored #1113

Closed
fullstack-engineer wants to merge 1 commits from fix/approvals-terminal-db-err-logging into staging

1 Commits

Author SHA1 Message Date
fullstack-engineer 18264bb500 fix(handlers): log DB Scan/Exec errors previously silently ignored
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 1m9s
Harness Replays / detect-changes (pull_request) Successful in 44s
CI / Detect changes (pull_request) Successful in 1m38s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 33s
qa-review / approved (pull_request) Successful in 1m2s
gate-check-v3 / gate-check (pull_request) Successful in 1m5s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m51s
security-review / approved (pull_request) Successful in 1m1s
E2E API Smoke Test / detect-changes (pull_request) Successful in 2m15s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 2m13s
sop-tier-check / tier-check (pull_request) Successful in 39s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 1m45s
Harness Replays / Harness Replays (pull_request) Successful in 16s
CI / Canvas (Next.js) (pull_request) Successful in 17s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 16s
CI / Python Lint & Test (pull_request) Successful in 20s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 15s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 3m36s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / Platform (Go) (pull_request) Failing after 12m56s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Failing after 13m22s
CI / all-required (pull_request) Successful in 8s
sop-checklist / all-items-acked (pull_request) [info tier:low] acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, l
audit-force-merge / audit (pull_request) Has been skipped
Four sites had chained DB calls where the error was silently discarded:

approvals.go Create: parent workspace lookup Scan error ignored → if the
DB connection fails, the escalation is silently skipped rather than logged.

approvals.go ListAll: auto-expire ExecContext error ignored → stale
approvals accumulate without logging on DB failure.

terminal.go HandleConnect: instance_id lookup Scan error ignored → if the
workspace row lookup fails, the terminal falls through to local Docker
without any diagnostic.

terminal.go handleLocalConnect: workspace name lookup Scan error ignored →
same pattern as above.

Fix: capture and log each error with handler + workspace context so
operators can diagnose DB connectivity or permission issues.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 02:14:35 +00:00