HTTPfy

500 Internal Server Error

The server hit an unexpected condition that stopped it from fulfilling the request.

500 at a glance

Code
500
Name
Internal Server Error
Class
5xx Server error
Status
IANA-registered standard code
Defined in
RFC 9110, Section 15.6.1
Cacheable by default
No by default. Caches store it only when the response carries explicit freshness (Cache-Control max-age, s-maxage or Expires).

What 500 means

500 Internal Server Error is the catch-all for server-side failures. It tells the client nothing about the cause, by design: the details belong in the server logs, not in the response. Retrying may or may not help, depending on whether the fault is a bug or a transient problem.

What typically causes a 500

  • An uncaught exception in the application (Python traceback, Node.js unhandled error, Java exception, PHP fatal error).
  • Apache: a syntax error or unsupported directive in .htaccess (the error log says "Invalid command").
  • Misconfigured file permissions on CGI scripts, or a missing module/extension after an upgrade.
  • Database connection failures or exhausted pools surfacing as unhandled errors.
  • Running out of memory or disk while handling the request.

Fix it on the server

  • Check the application and web-server error logs at the timestamp of the request; the stack trace names the line.
  • Turn on error tracking (Sentry and similar) so every 500 is recorded with context.
  • Never show stack traces to users in production; return a generic page and a request ID they can quote.
  • If the failure is an upstream dependency, consider 502/503/504 instead so clients and monitors know what kind of failure it is.

Fix it as a client or visitor

  • Retry once after a short delay; if it persists, report it with the time and any request ID shown.
  • For APIs, check whether a specific input triggers it (a server bug on an edge case is common).

Headers that go with 500

HeaderRole
X-Request-IdNot standard, but many servers include a correlation ID to quote to support.

Example response

HTTP/1.1 500 Internal Server Error
Content-Type: application/json
X-Request-Id: 9f1c2e7a

{"error": "internal_error", "request_id": "9f1c2e7a"}

Opens the HTTP headers tool with your URL filled in; it shows the status line and headers of every redirect hop.