5xx

500 Internal Server Error

The server encountered an unexpected condition that prevented it from fulfilling the request.

What is HTTP 500?

This is the most generic server-side error code, indicating that something went wrong on the server but the exact cause is not specified. It serves as a catch-all for unhandled exceptions, programming errors, or unexpected conditions. The server logs typically contain more detailed information about what went wrong. This should not be used when a more specific 5xx status code applies to the situation.

Defined in RFC 9110

Common Causes

  • An unhandled exception or programming error in the server-side application code
  • Database connection failures or query errors during request processing
  • Missing or misconfigured server dependencies, environment variables, or configuration files
  • Out-of-memory conditions or resource exhaustion on the server

How to Fix

  • Check the server error logs for the specific exception, stack trace, or error message
  • If you are the server operator, review recent code deployments for bugs
  • Verify database connections, external service integrations, and configuration files are correct
  • If you are a client, retry the request after a short delay; the issue may be transient