Toolman

HTTP 500 — Internal Server Error

5xx Server Error

What it means

The server hit an unhandled error. It is the catch-all for "something broke and we did not anticipate it".

What to do about it

Read the server logs — the status code itself tells you nothing. Common causes are an unhandled exception, a failed database connection, or a null dereference in a code path that was never tested.

Where it sits

500 belongs to the 5xx family: The server failed to fulfil an apparently valid request. The fix is on the server side.

HTTP/1.1 500 Internal Server Error

Checking it yourself

# see the status code and headers only
curl -sI https://example.com/path

# follow redirects and print each hop
curl -sIL -o /dev/null -w "%{http_code} %{url_effective}\n" https://example.com/path

# JavaScript
const r = await fetch(url);
console.log(r.status, r.statusText);

How this code behaves

Cacheable by defaultNo — caches must not store this response unless explicit cache headers permit it.
Safe to retryYes, with backoff. This is a transient condition; retrying the same request is reasonable.
Effect on search indexingRepeated server errors reduce crawl rate and eventually drop pages from the index.

Returning 500 correctly

# nginx
return 500;

# Express
res.status(500).json({ error: 'Internal Server Error' });

# Go
w.WriteHeader(500)

# Python (Flask)
return jsonify(error='Internal Server Error'), 500;

Frequently asked questions

What does HTTP 500 mean?

The server hit an unhandled error. It is the catch-all for "something broke and we did not anticipate it".

How do I fix a 500 error?

Read the server logs — the status code itself tells you nothing. Common causes are an unhandled exception, a failed database connection, or a null dereference in a code path that was never tested.

Is 500 a client or server problem?

A server problem. The request was valid; the server failed to fulfil it. Nothing the client changes will help.

Other 5xx codes

All HTTP status codes