We shipped a change that signs our render links with a secret held in the server environment instead of a value stored in the database. It has a guard: if the secret is missing, refuse to issue a link rather than fall back to something weaker. The guard returns 503 .
Then production returned a 503 for a request that should never have reached that guard — and the body attached to it belonged to a different response entirely.
POST / v1 / render - link ( invalid API key )
HTTP / 2 503 { "error" : "unauthorized" , "message" : "Invalid API key" }
Enter fullscreen mode
Exit fullscreen mode
A 503 status carrying a 401 body. That combination is not supposed to be constructible. This is how it happened, including the four attempts to reproduce it that all failed, and the Fastify behaviour underneath.
Reading the mismatch
The body is unambiguous: "Invalid API key" is the string our authentication middleware sends. Our global error handler has its own wording for a missing key — "Missing API key.…