What it means
The server hit an unexpected condition and couldn't complete the request. It's the generic server error: something broke, and the server isn't saying what.
Why you're seeing it
- An unhandled exception or crash in application code.
- A failed database query or missing configuration, such as an unset environment variable.
- Bad server configuration, such as a broken
.htaccessfile.
How to fix it
- Check the server logs; the real error is there, not in the response.
- Clients can retry idempotent requests once, but repeated
500s need a fix on the server. - Don't leak stack traces to users; log them and return a request ID instead.
Example response
HTTP/1.1 500 Internal Server Error Content-Type: application/json {"error": "internal", "request_id": "req_8f2c1a"}