Right after a release, 500s spike to 8% and logs show `java.lang.NullPointerException` in a new code path.
BeginnerTroubleshooting5xx errors
Answer
Likely causes → A code bug exposed by production data that tests didn't cover (null fields, old records missing a new column).
Diagnose →
kubectl logs -n prod -l app=api --since=10m | grep -c NullPointerException
kubectl rollout history deploy/api -n prod
Group errors by endpoint in your error tracker (Sentry and similar) to confirm it's one code path.
Fix → kubectl rollout undo deploy/api -n prod immediately. Fix forward only if rollback is impossible (e.g. an irreversible migration).
Prevent → Canary releases with automatic rollback on error rate, and tests seeded with anonymized production-shaped data.
More on 5xx errors
Long-running report exports fail with "504 Gateway Time-out" from the ALB at exactly 60 seconds.Beginnernginx logs "upstream prematurely closed connection while reading response header from upstream" and users get 502.IntermediateEvery deploy causes 10–20 seconds of 502s from the ALB, even with a rolling update.IntermediateA Node.js service behind an ALB returns a steady trickle of 502s under normal load, with no app errors at all.AdvancedThrough Istio, clients get "503 upstream connect error or disconnect/reset before headers. reset reason: connection failure".IntermediateAPI Gateway returns "502 Bad Gateway" and the logs say "Execution failed due to configuration error: Malformed Lambda proxy response".Beginner