Long-running report exports fail with "504 Gateway Time-out" from the ALB at exactly 60 seconds.
BeginnerTroubleshooting5xx errors
Answer
Likely causes → The ALB idle timeout (default 60 s) closes the connection because no bytes flowed while the report was generated.
Diagnose → ALB access logs show elb_status_code=504 with target_processing_time=-1 and request durations clustered at 60 s.
Fix → Short term: raise the idle timeout (aws elbv2 modify-load-balancer-attributes --attributes Key=idle_timeout.timeout_seconds,Value=300). Right fix: make it asynchronous. Return 202 Accepted with a job ID, generate the report in a worker, and let the client poll or get a download link.
Prevent → Any request expected to exceed a few seconds goes through a job queue by design.
More on 5xx errors
Right after a release, 500s spike to 8% and logs show `java.lang.NullPointerException` in a new code path.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