Server error · 500

500 Internal Server Error

A 500 Internal Server Error means the server accepted a request it should have been able to handle, then hit an unhandled failure. The status is a generic signal. The cause is in the application log, not in the number.

HTTP status codes explained · the longer reference on the blog.

What 500 means

The app, or a framework around it, caught an exception it did not turn into a more specific status and responded with 500. Typical triggers are an uncaught exception, a database error the route did not handle, a missing environment variable after a deploy, or a template that crashed while rendering. The HTTP stack is working. The request got far enough to run your code.

Proxies sometimes replace a crashed upstream with 502 Bad Gateway instead, because the app never produced a status line. When you do see 500, the process was alive long enough to send that status. A CDN can also cache a 500 if cache rules are wrong, so later visitors see a stale failure after you have already fixed the bug.

Common causes

  • An unhandled exception in the request path

    A null field, a failed assertion, or a library throwing on bad data. The framework’s error handler turns it into 500 and a stack trace in the log.

  • A dependency failed

    The database rejected the connection, a migration was not applied, or a required API returned an error that this route does not catch. The web process is up and still answers 500.

  • Configuration from the last deploy

    A missing secret, a wrong file path, or an incompatible build. It often starts at the moment of release and hits every request to one route.

  • A cached error page

    The origin has recovered, and the CDN is still serving the 500. A request that skips the cache returns 200. Purging the URL fixes the public status.

How to fix it

  • Open the application log for the same timestamp

    The stack trace, SQL error, or missing-env message is the diagnosis. The 500 page in the browser rarely includes it in production, which is what you want for visitors.

  • Compare the last deploy with the first failing request

    If they match, roll back or fix forward. Check migrations and env vars on the host that is actually serving traffic, not only on your laptop.

  • Hit one healthy route and the failing route

    A 500 on a single path is a bug in that path. A 500 on every path is a boot failure, a bad config, or a down dependency shared by the app.

  • Bypass the CDN once

    Request the origin, or purge the URL. If the origin is 200 and the CDN is 500, the cache is the remaining problem.

Is it your site, or just you?

Reload in a private window and on another network. A 500 that appears for everyone is the app. A 500 only inside a logged-in session is that session’s data or a permission bug, and the public site can still be up.

The homepage checker loads the URL without your cookies. If it reports HTTP 500, anonymous visitors can get the same error. If it reports 200, try the URL signed out before you treat the whole site as down.

How to monitor for 500

Monitor the public URL and expect 200. HTTP 500 fails that check. You get the first alert after a second consecutive failure, so a one-off exception during a deploy does not page you, and a persistent 500 does. The alert includes the status. Read the app log for the exception. The monitor cannot see your stack trace.

The checker on the ismysiteup homepage requests the URL from our servers and shows the HTTP status, response time, and SSL details. No account is required, and that checker allows 5 checks per hour from the same network. A free account watches 5 URLs, each checked every 10 minutes, and sends alerts on WhatsApp, Telegram, Slack, or email. A monitor expects HTTP 200 unless you set a different expected status (100–599). One failed check is confirmed with a second check before the first alert, and a later success sends a recovery alert. Pro (every 5 minutes) and Business (every minute) are listed on the pricing page; paid checkout is not open yet.

Compare Free, Pro, and Business

Related status codes

FAQ

What does 500 Internal Server Error mean?

The server hit an unexpected condition and did not have a more specific status to send. It confirms the app failed. It does not name the bug.

How is 500 different from 502?

500 is an HTTP response the application sent. 502 means a proxy never got a valid HTTP response from the application, often because the process crashed or was not listening.

Can a 500 be cached?

Yes, if the CDN is allowed to store it. After the origin is fixed, purge the URL or check the origin directly so you are not looking at a stored error.