Prometheus repair after server update (PHP8.1)
As discussed, some details of yesterday's repair on Prometheus:
1. user reported error: 502 Bad Gateway when accessing https://woolwich.maxcommunications.co.uk/IWM4/
1. user reported error: 502 Bad Gateway when accessing https://woolwich.maxcommunications.co.uk/IWM4/
2. this site is served by a combination of Pandora and Prometheus
3. first I tried some quick fixes:
3.1. restart nginx, php* on Pandora
3.2. restart nginx, php*, haproxy on Prometheus
4. these were unsuccessful so then I decided to "follow the traffic" and checked the haproxy config to see which server would receive the traffic from the web - it was Prometheus
3.1. restart nginx, php* on Pandora
3.2. restart nginx, php*, haproxy on Prometheus
4. these were unsuccessful so then I decided to "follow the traffic" and checked the haproxy config to see which server would receive the traffic from the web - it was Prometheus
5. I checked the status of the services on Prometheus and found that the "php8.1-fpm" service was dead ("inactive") due to "no such file or directory" on its .sock file
6. I checked the directory where .sock files are kept and noticed that a .sock file for PHP 8.1 was present, but not for PHP 7.4 - the websites were expecting PHP 7.4
7. I realised that due to the upgrade of Prometheus the day before, PHP had been upgraded on Prometheus and it was now running PHP 8 - the solution was thus to tell the websites to look for PHP 8, instead of PHP 7
8. this was done by editing the nginx config files for each site served by Prometheus: /etc/nginx/sites-available/*
9. a change was needed in TWO places: a) the "upstream" section at the very top of the file; b) the "fastcgi_pass" setting in the main server block
10. the final step was to restart nginx (causing the edited config files to be reloaded)