HTTP 500 Internal Server Error
The server encountered an unexpected condition that prevented it from fulfilling the request.
5xx Server Error
500
Internal Server Error
Description
The 500 Internal Server Error status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. This is a generic error message given when an unexpected condition was encountered and no more specific message is suitable. It is the most general server-side error response. A 500 error typically indicates a bug in the server-side code, an unhandled exception, a misconfigured server, a database connection failure, or some other internal issue. Unlike client errors (4xx), the problem is on the server's end, and the client's request was likely valid.
When Is It Used?
Returned when the server encounters an unhandled exception or error during request processing. Common causes include uncaught exceptions in application code, database failures, null pointer errors, configuration issues, or resource exhaustion.
Example Response
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{"error": "internal_server_error", "message": "An unexpected error occurred. Please try again later."}Related Status Codes
502
Bad Gateway
The server, while acting as a gateway or proxy, received an invalid response from the upstream server.
503
Service Unavailable
The server is currently unable to handle the request due to temporary overload or maintenance.
504
Gateway Timeout
The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server.
400
Bad Request
The server cannot process the request due to a client error.