Server Error · 5xx

500 Internal Server Error

The server hit an unhandled error while processing the request.

What 500 Internal Server Error means

500 Internal Server Error is the catch-all server-fault code. The server encountered an unexpected condition (uncaught exception, null pointer, database connection refused, deserialization crash) and could not complete the request. 500 says nothing about why; the actual cause is in the server logs. From the client's perspective, 500 means "this is not your fault, retry might help, file a bug if it persists".

When servers should return it: Return 500 only for genuinely unexpected server-side failures. Use 503 for known overload, 502 for upstream failures, 504 for upstream timeouts.

Common causes

How to fix 500 Internal Server Error

Example response

HTTP/2 500
content-type: application/json
{"error":"internal server error","request_id":"abc123"}

Related status codes

Frequently Asked Questions

What is the request_id field for?
When you file a bug report, the server team can pull the exact stack trace and context for your specific failed request. Always include it.
Should I retry on 500?
Yes, with exponential backoff. Many 500s are transient. If they persist, the underlying bug needs a fix on the server side.
How do I avoid 500s in my own service?
Catch exceptions at the request boundary, convert known failure modes to specific 4xx codes (validation errors → 422, missing → 404, etc.), and reserve 500 for truly unexpected failures.
Defined in: RFC 9110 · Class: 5xx Server Error

More references

For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.