My LibreNMS instance was running great, but then the interface went off-line. Now, we just get a 502 Bad Gateway error. I feel like I’m chasing my tail at this point, trying to come up with the right answer from a bunch of different support forum posts that don’t quite match what’s going on with my server.
From what I was able to gather from other support forum posts, this is a permissions issue, but I don’t know why my librenms user would be unable to access the socket. I followed the installation instructions very closely, and like I said in my original post, my LibreNMS system was running great for about six months.
I’ve reviewed the installation instructions, trying to locate the problem. My php-fpm configuration is correct including “listen = /run/php-fpm-librenms.sock” as my listen instructions in the librenms.conf file in my /etc/php/8.3/fpm/pool.d directory, and also the proper “librenms” settings in user, group, and pool. Also, my nginx config settings, in the /etc/nginx/conf.d/librenms.conf file, match the installation instructions. Additionally, the nginx config file matches the socket location (fastcgi_pass unix:/run/php-fpm-librenms.sock) that’s in the php-fpm “listen” line.
Ended up poking around and fixing this myself. The unix socket permissions section of the config file at /etc/php/8.3/fpm/pool.d/librenms.conf weren’t correct. Everything started working again once I rewrote that section to:
listen.owner = www-data
listen.group = www-data
listen.mode = 0660