You did something wrong. These are your problem to fix and should trigger alerts.
500 Internal Server Error
Meaning: Generic server error — the application threw an unhandled exception. What to check (in order):
- Application logs — the stack trace is in there
- Recent deployment — did something ship in the last hour?
- Downstream dependencies — database connection, downstream API, cache
- Resource exhaustion — out of memory (OOMKilled in K8s), thread pool exhausted, file handles
- Config issue — environment variable missing, secret rotated incorrectly
Common 500 root causes:
- Null pointer / undefined reference
- Unhandled exception in a code path that wasn't tested
- Database query timing out
- External API returning unexpected response that the code can't handle
- Config typo in the latest deploy
501 Not Implemented
Meaning: Server doesn't recognise the HTTP method. What to check: Rare in modern systems. Usually indicates a proxy or framework misconfiguration.
502 Bad Gateway
Meaning: The reverse proxy / load balancer got an invalid response from upstream. What to check:
- Upstream is down or crashed — target group shows unhealthy
- Upstream returned a malformed response (cut connection mid-response)
- Upstream timed out before responding
- Application restarted during request handling
- Container OOMKilled mid-request
502 troubleshooting flow:
- Check load balancer / Ingress target health
- Check upstream pod/instance status (running, healthy)
- Check upstream logs for crashes or panics
- Check
kubectl describe podfor OOMKilled or restart loops - Check resource limits — is the container hitting memory cap?
502 is the most common cause of "site went down for 5 minutes." Almost always upstream health.
503 Service Unavailable
Meaning: Server is temporarily unable to handle the request. Either overloaded or in maintenance. What to check:
- No healthy upstream targets — ALB shows 0/N healthy
- Autoscaling can't keep up with traffic spike
- Maintenance mode flag still on after a deployment
- Circuit breaker open — application self-protecting from cascading failure
- Database connection pool exhausted
503 vs 502: 503 usually means the server knows it can't serve (overloaded, in maintenance). 502 means the proxy tried but got nothing useful back.
504 Gateway Timeout
Meaning: Reverse proxy waited for upstream and gave up. What to check:
- Upstream is slow but not failed
- Database query running long
- Downstream API call hanging
- Long-running synchronous work that should be async
- Load balancer timeout shorter than expected response time (common gotcha — ALB default is 60s)
504 troubleshooting flow:
- Compare load balancer timeout to typical upstream response time
- Check upstream APM / traces for slow operations
- Check database for long-running queries (
pg_stat_activityin Postgres,SHOW PROCESSLISTin MySQL) - Check thread pool / worker saturation in the application
- Check downstream service health and latency
505 HTTP Version Not Supported
Meaning: Server doesn't support the HTTP version in the request. What to check: Almost always a client/proxy misconfiguration. Rare.