Skip to content
5xx Server Error Safe to retry

500 Internal Server Error

The server hit an unhandled condition. It is a catch-all, not a diagnosis.

What causes it

  • An unhandled exception in application code.
  • A database connection failure or a missing environment variable in the deployed build.
  • A syntax error in server configuration, or a bad `.htaccess` directive.
  • File permissions preventing a script from executing.

How to fix it

  • The status tells you nothing — go straight to the server error log. In nginx that is usually `/var/log/nginx/error.log`; in a PaaS, the platform log stream.
  • Reproduce with the same request locally and turn on stack traces in a non-production environment only.
  • Never leak a stack trace to the client; return a request ID and log the detail server-side.

At a glance

Class
5xx Server Error
Reference
RFC 9110 §15.6.1
Standardised
Yes
Retry the request?
Yes, with backoff

Other 5xx server error codes

Back to the full HTTP status code reference