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

← All HTTP status codes · HTTP status cheat sheet · HTTP headers reference