500 Internal Server Error
This is an educational reference page about HTTP 500 Internal Server Error. The page itself is served as 200 OK so it can be indexed as HTTP documentation.
A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.
What it means
HTTP 500 means the server hit an unexpected error and could not complete the request.
Common causes
- Unhandled exceptions, failed assumptions, nil values, or runtime crashes.
- Configuration, dependency, or database failures surfaced as application errors.
- The server intentionally hides internal details from clients.
How to fix it
- Log request IDs and exception details server-side.
- Return a generic client-safe message and avoid leaking stack traces.
- Add monitoring and tests around the code path that crashed.
Example response
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{"error":"Internal server error"}
Developer notes
500 is a fallback server error. Prefer a more specific 5xx status when the failure mode is known.