500s affect only a few specific customers; everyone else is fine.
AdvancedTroubleshooting5xx errors
Answer
Likely causes → Data-dependent bugs: a record with an unexpected value (null, unicode, very large list), a tenant on a different shard or plan, a feature flag enabled for those tenants, or a poison message that keeps failing.
Diagnose → Filter error logs by tenant ID and endpoint. Pull the failing request's trace and the exact record it loaded. Check feature flag targeting and shard mapping for those tenants.
Fix → Turn off the flag for those tenants, or patch the bad data (with a backup first). Move poison messages to a dead-letter queue.
Prevent → Structured logs with tenant ID on every line, alerts on per-tenant error rate, and input validation at write time.
More on 5xx errors
Right after a release, 500s spike to 8% and logs show `java.lang.NullPointerException` in a new code path.BeginnerLong-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".Intermediate