server error RFC 9110
HTTP 500 Internal Server Error
Something went wrong on the server side — usually an unhandled exception.
What it means
The generic server-side error. An exception was thrown, a database query failed, a null was dereferenced. The client did nothing wrong; the server needs to fix itself. Should never surface user-facing details in a 500 response body (leaks internal implementation).
When servers send it
- •Unhandled exception in application code
- •Database connection failed mid-request
- •Null pointer / undefined property access
- •Out-of-memory error in the process
What the client does
Shows a generic error. May retry (idempotent requests only). Should NOT loop retries — 500 usually means the server is broken.
Common causes
- •Bug in application code
- •Database is down or query timed out
- •Missing environment variable causing runtime crash
- •Third-party API dependency failed
How to fix it
- 1.Check server logs immediately
- 2.Look for stack traces in APM (Sentry, DataDog, etc.)
- 3.Correlate with recent deploys — did something ship in the last hour?
- 4.Check database, external services, and env vars
Similar codes
502 Bad Gateway server error
A gateway or proxy received an invalid response from the upstream server.
503 Service Unavailable server error
Server is temporarily unable to handle the request — overloaded or down for maintenance.
504 Gateway Timeout server error
A gateway or proxy timed out waiting for a response from the upstream server.
501 Not Implemented server error
Server doesn't support the functionality required to fulfill the request.
← All HTTP status codes · HTTP status cheat sheet · HTTP headers reference