500 Internal Server Error

The server hit an unexpected condition and cannot say anything more specific about it.

Status

HTTP/1.1 500 Internal Server Error

Details

500 is the generic server failure. Something threw, and the server has no better code to describe it. The cause is on the server side, so nothing the client changes about the request is guaranteed to help.

Because it is a catch-all, a 500 is only useful with a correlation identifier. Returning an opaque error page with a request id, and logging the stack trace against that id, is the difference between a solvable incident and an unreproducible one. Never return the trace itself: it leaks paths, versions, and query structure.

Common causes

How to fix it

As the client

As the server

Examples

GET /api/v2/order/40213 HTTP/1.1
Host: api.example.com

HTTP/1.1 500 Internal Server Error
Content-Type: application/json; charset=utf-8

{"error":"internal_error","request_id":"01J9X2K4M7"}

Specifications

RFC 9110 §15.6.1

See also