One of the great things about Trellis, as I thought, is the deployment mechanism. That must be fail safe and it should make me able to switch between application versions securely and indeed in an instant – I thought.
However when I was playing around with deploy on a DO droplet, I encountered a 502 Bad Gateway while deploying with trellis. Part of the error message from /srv/www/sitename/logs/error.log looks like:
[error] 4691#4691: *438 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 18.104.22.168, server: do.krx.hu, request: "GET /wp/wp-admin/themes.php HTTP/2.0", u pstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:"
(I was checking the Themes page in admin because I was deploying a new theme, so I would see obviously when the deploy occurred by the new theme showing up.)
So I was actually deploying when I encountered this one-time 502 error. I caught it because I was intentionally testing and hoped that I will not catch any such thing. But I did, unfortunately. I am fairly new to this whole ecosystem of Trellis-Bedrock-Sage, so I thought I will ask the experienced ones in the community.
Do you think that this indeed happens by deploys? How can this be better tested? Is this a limitation or a bug then? Is it because the php-fpm restart? Is that really needed? Is there a way to overcome this?