HTTP status · 5xx — server error
500 Internal Server Error
500 Internal Server Error means the server hit an unexpected condition and could not complete the request.
Key facts
| Class | 5xx — server error |
|---|---|
| Standard | RFC 9110 §15.6.1 |
| Cacheable by default | No |
| Cause | Unhandled exception or server misconfiguration |
| Fix side | Server logs |
What 500 means
The server encountered an unexpected condition that prevented it from fulfilling the request. It is the generic server-side failure: an uncaught exception, a missing configuration value, a failed database call that was not handled, or a template error. The client cannot fix it by changing the request.
How to find the cause
Start with the server log entry that matches the request time and path; the status alone rarely identifies the bug. Check the application log, then the upstream service and database logs. Correlate with deploys and configuration changes. Return a generic error page to users and keep stack traces, SQL and secrets out of the response — a 500 body is visible to the world and is a common source of information leaks.
Frequently asked questions
Is a 500 always a bug in the application?
Not always. It can come from a misconfigured server, a missing environment variable or a dependency that failed. The common factor is that the server did not handle the condition.
Should a 500 response include the error message?
No. Log the details server-side and return a generic message. Detailed errors can expose internals and are not useful to end users.