Upgrading from php 7.4 to php 8.1 502 bad gateway

Hi,
Having trouble with accessing Librenms management portal with ERROR;
502 bad gateway
nginx/1.18.0 (Ubuntu)

I have followed multiple steps from this forum and each time (3 attempt) end with the same outcome/error.

Both ./daily.sh & ./validate.php output/s are OK and passed. Not sure where to go from here any help would be great.

Component Version
LibreNMS 22.10.0 (2022-10-18T15:47:05+11:00)
DB Schema 2022_09_03_091314_update_ports_adsl_table_with_defaults (246)
PHP 8.1.2-1ubuntu2.6
Python 3.10.6
Database MariaDB 10.6.7-MariaDB-2ubuntu1.1
RRDTool 1.7.2
SNMP 5.9.1

Thanks,
N

Check the nginx log for more information on error

also check which version of php is running with below command

ps aux | grep php

Most likely php-fpm see: Upgrading Ubuntu 20 to Ubuntu 22 and PHP 8.1 - #5 by murrant

Have tried Murrant`s fix and did not resolve.

Thx

ps aux | grep php

ps aux | grep php
root 1005 0.0 0.0 2888 984 ? S Oct26 0:00 /bin/sh -c /opt/librenms/syslog.php
root 1015 0.2 1.4 113772 48860 ? S Oct26 2:44 php /opt/librenms/syslog.php
root 47362 0.0 0.8 223812 28112 ? Ss Oct26 0:02 php-fpm: master process (/etc/php/8.1/fpm/php-fpm.conf)
www-data 47366 0.0 0.3 224324 10624 ? S Oct26 0:00 php-fpm: pool www
www-data 47367 0.0 0.3 224324 10624 ? S Oct26 0:00 php-fpm: pool www
librenms 1774883 5.5 1.5 115888 53604 ? Ss 08:07 0:00 php /opt/librenms/poller.php -h 36
librenms 1774961 7.2 1.5 115892 53708 ? Ss 08:07 0:00 php /opt/librenms/poller.php -h 21
librenms 1775022 11.0 1.5 115828 52568 ? Ss 08:07 0:00 php /opt/librenms/poller.php -h 201
librenms 1775038 22.0 1.5 115828 52912 ? Ss 08:07 0:00 php /opt/librenms/poller.php -h 203
librenms 1775069 0.0 0.0 6476 2352 pts/2 S+ 08:07 0:00 grep php

Can you point me to the correct path to ngnix logs please.

I think I found the log file.

root@LNMS-01:/opt/librenms# cat /var/log/nginx/error.log
2022/10/27 07:46:29 [crit] 46732#46732: *18 connect() to unix:/run/php-fpm-librenms.sock failed (2: No such file or directory) while connecting to upstream, client: 10.x.x.x, server: , request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/run/php-fpm-librenms.sock:”, host: “10.x.x.x”

sudo service php-fpm status
Unit php-fpm.service could not be found.

OK I am back online again.
Solution was to edit;
/etc/php/8.1/fpm/pool.d/librenms.conf

Change [www] to [librenms]:
Change user and group to “librenms”:

user = librenms
group = librenms

Change `listen` to a unique name:

listen = /run/php-fpm-librenms.sock

Then restart:
systemctl restart nginx
systemctl restart php8.1-fpm

Thanks for your help guys.

cheers,

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.