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.

All Real-World Interview questions Roadmap: Interview readiness

More on 5xx errors