#843 health/metrics 500s: get_health_metrics builds jumper.r_%I, breaks on queue named "default"
Description
EditEARS SPEC:
- When get_health_metrics builds a per-queue SQL statement, the Highway health metrics function shall quote the COMPLETE table identifier (jumper.%I with 'r_' || queue_name), never a prefix concatenated with a quoted suffix (jumper.r_%I).
- If a registered queue name requires SQL quoting (reserved word such as "default", mixed case, or special characters), then the Highway health metrics function shall still return that queue's metrics rather than raising relation "jumper.r_" does not exist.
- When GET /api/v1/health/metrics is called while a queue named "default" is registered in jumper.queues, the Highway API shall return HTTP 200 with tasks/queues/critical/resilience entries for that queue.
- If a per-queue metric query fails, then the Highway health metrics function shall emit an explicit error metric for that queue with severity critical and continue with the remaining queues, rather than aborting the whole endpoint.
- The Highway migration set shall apply cleanly on a database in which a quoting-sensitive queue name already exists (migrations 01KCFHD2VY11DZ6K23N3P9KEAE and 01KCFHDGKRZZ5M77GZJ9W01ENK carry the same jumper.t_%I / jumper.r_%I defect).
EVIDENCE (reproduced 2026-08-03):
- GET /api/v1/health/metrics -> 500 METRICS_ERROR: relation "jumper.r_" does not exist; QUERY: SELECT count(*) FROM jumper.r_"default" ...; CONTEXT: get_health_metrics(interval,text) line 199.
- jumper.queues contains: highway_default, highway_internal, highway_activity (2026-06-17) and default (created 2026-07-16 19:19:55Z) -> endpoint has been dead since 2026-07-16.
- Source: docker/highway-core/migrations/01KGTW6CKQQ82ATSPXHSV93P8A_add_get_health_metrics_function.sql lines 215,225,235,245,257,267,277,288,300,310 (10 occurrences).
- Python callers are NOT affected: they use psycopg sql.Identifier(f"r_{queue}") which quotes the whole name correctly. Defect is confined to PL/pgSQL migrations.
- Violates issuedb memory [lessons] sql_injection_prevention (identifier quoting discipline).
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...