5xx Server error

HTTP 500 Internal Server Error

A generic error: the server hit an unexpected condition and could not fulfil the request.

500 Internal Server Error is the generic answer when the server hit an unexpected problem and has no more specific code to give. The fault is on the server side.

HTTP/1.1 500 Internal Server Error

Common causes

  • An unhandled exception in the application code.
  • A misconfiguration, such as an invalid .htaccess file or missing environment variable.
  • A failing database query or dependency that the code does not handle.

How to fix it

  • As a client, retry later; if it keeps happening, report it with the time and request details.
  • As the server owner, check the application and server error logs: the stack trace is there, not in the response.
  • Return a more specific status (400, 404, 503) when the cause is known.

Related status codes

Other status codes

1xx Informational

2xx Success

3xx Redirection

5xx Server error

Search all HTTP status codes