500 Internal Server Error
The application hit an error it did not handle
Seen in Web servers, APIs, frameworks
Something failed inside the server while handling the request, and it returned a generic error instead of a result.
Common causes
- An unhandled exception in application code.
- A missing environment variable, secret or config file.
- A failing database or downstream dependency the app does not handle.
- A syntax error in server config such as an Apache .htaccess file.
How to fix it
- Check the application error log at the time of the request; the stack trace names the cause.
- Reproduce with the same request and inputs in a staging environment.
- Check recent deploys and config changes, and roll back if the errors started with one.
Got a different message? Paste it into the error explainer.
Related errors
- 502 Bad Gateway · The proxy got a bad response from the server behind it
- 504 Gateway Timeout · The server behind the proxy took too long
- Error 520: Web server is returning an unknown error · Cloudflare got an empty or invalid response
- 429 Too Many Requests · You've hit a rate limit
- 400 Bad Request · The server could not understand the request
- 401 Unauthorized · The request needs valid credentials
- 403 Forbidden · The server refuses to allow this request
- 404 Not Found · Nothing exists at this URL
- 405 Method Not Allowed · This URL does not accept that HTTP method
- 410 Gone · The resource was removed on purpose
- 414 Request-URI Too Large · The URL is longer than the server accepts
- 400 Bad Request: The plain HTTP request was sent to HTTPS port · Plain HTTP was sent to a port that expects TLS