'AWS Elastic Beanstalk Nginx Php-fpm error
A few days ago we experienced a complete outage of my Elastic Beanstalk server, and I still don't underdestand why. Suddenly the server ALB responded a 502 Bad Gateway error to every request.
There was no code change at all when it happened, otherwise it would have been easy to rollback. And all the associated AWS services like RDS and Elasticache were running healthy.
After digging in the access logs, it looked like the error was a problem with Nginx and PHP-Fpm, I had a lot of those 2 errors:
connect() to unix:/run/php-fpm/www.sock failed
and
upstream timed out (110: Connection timed out) while reading response header from upstream, client: 172.42.0.214, server: , request: “POST /my/url HTTP/1.1”, upstream: “fastcgi://unix:/run/php-fpm/www.sock”, host: “api.myservice.com”
Even after rebuiling another environment from scratch, it was still giving that same error 502 Bad Gateway. After 1 hour break away from my computer, scratching my head, I went back and everything was running fine without any reason!
That's the point of this question: do you know what could possibly cause this kind of issue without code and configuration change? And how to avoid it?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
