Skip to content

fix(health): /health/ready 503 on HANA crash-loops every deploy (#2975) - #2995

Merged
jung-thomas merged 1 commit into
DEVfrom
worktree-fix-health-ready-hana-2975
Nov 2, 2026
Merged

jung-thomas merged 1 commit into
DEVfrom
worktree-fix-health-ready-hana-2975

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Problem

The #2975 blue-green readiness gate crash-loops tutorials-srv on every deploy to a HANA environment (observed on DEV deploy 2026-11-02, instances 0/1, repeated exit 137).

/health/ready probes the DB with a bare SELECT 1. HANA rejects that — sql syntax error: line 1 col 8; HANA requires SELECT 1 FROM DUMMY. So dbOk is always false on HANA → /health/ready always returns 503 → CF's startup health check (added by the same #2975) never passes → CF kills the app at 60s → crash loop. The app never becomes reachable.

Confirmed against DEV HANA:

bare 'SELECT 1'        -> FAILS: sql syntax error: line 1 col 8 (at pos 8)
'SELECT 1 FROM DUMMY'  -> OK

The integration test (test/integration/health-ready.test.js) runs on in-memory SQLite, where bare SELECT 1 works — so it passed green while the real HANA path was broken.

Fix

  • Add dbPingSql(kind) to srv/lib/scheduler-ready.js: SELECT 1 FROM DUMMY on hana, SELECT 1 otherwise.
  • Use it in /health/ready (cds.db.kind) — the actual crash fix.
  • Also fix the mirror bug in /health/db, which used an unconditional SELECT 1 FROM DUMMY (broken on SQLite).
  • Unit tests assert both dialects; existing integration test still green.

Impact

Without this, the #2975 readiness-gate batch cannot deploy to DEV or PROD at all. This blocks the DEV→main release that also carries the #2909 draft-integrity fix (#2992).

Related: #2975.

🤖 Generated with Claude Code

…very deploy (#2975)

The #2975 readiness gate probes the DB with a bare `SELECT 1`. HANA rejects
that ("sql syntax error") — it requires `SELECT 1 FROM DUMMY`. So dbOk was
ALWAYS false on HANA, /health/ready stayed 503, and CF's new startup health
gate (also #2975) killed tutorials-srv at 60s on every deploy → crash loop.

The integration test runs on in-memory SQLite (where bare `SELECT 1` works),
so it passed green while the real HANA path was broken — a classic
test-environment gap.

Fix: add dialect-safe `dbPingSql(kind)` to scheduler-ready.js
(`SELECT 1 FROM DUMMY` on hana, `SELECT 1` elsewhere) and use it in both
/health/ready and /health/db (the latter had the mirror bug: unconditional
`FROM DUMMY`, broken on SQLite). Unit tests cover both dialects.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant