LibreNMS stopped working

Seems like we need to have PHP 7.3 minimum

Yes, I have upgrade the php now. And now I’m running daily.sh again.
Stuck on “Cleaning up DB”… I guess i just need to wait and see when it’s done.

Seems to solved the problem with updateing Librenms.
But now I have another issue…
In NGINX logs I see /var/run/php-fpm/php7.2-fpm.sock failed

maybe try to restart the server to clear the lock file

After upgrading to PHP 7.3, I am able to succesfully run ./validate.php og .daily.php, but I get a nginx error - 502 Bad Gateway

[librenms- librenms]$ ./validate.php

Component Version
LibreNMS 1.70.1
DB Schema 2020_11_02_164331_add_powerstate_enum_to_vminfo (191)
PHP 7.3.25
Python 3.6.8
MySQL 5.5.68-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2
OpenSSL

====================================

[OK] Composer Version: 2.0.7
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

You need to change the reference in the nginx configuration file for librenms to /var/run/php-fpm/php7.2-fpm.sock to the file for your new version of php (7.3, 7.4)

Also make sure that file exists. /var/run/php-fpm/php7.4-fpm.sock or whatever version you have. Restart fpm and nginx after updating your files.

1 Like

Seems like you guys didn’t get switched to the PHP 7.2 support branch? Must be a bug there.

I have upgraded my Centos 7 PHP to 7.3.25, but now i get - 502 Bad Gateway

I was trying to figure out the changes needed for /var/run/php-fpm/php7.4-fpm.sock
but i only have this file - php-fpm.pid
I have trying updating nginx to point to this file, but it still gives me the same 502 error

your php-fpm service is not started?

it should be running
image

image

what socket file is specified in the php-fpm config?

I think this is what your asking for

from vi /etc/php-fpm.conf

;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;

[global]
; Pid file
; Default Value: none
pid = /run/php-fpm/php-fpm.pid

I have tried changing it to

;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;

[global]
; Pid file
; Default Value: none
pid = /var/run/php-fpm/php-fpm.pid

but I still get 502

[root@brnnetmonpro01 php-fpm]# pwd
/var/run/php-fpm

[root@- php-fpm]# ll
total 4
-rw-r–r--. 1 root root 5 Dec 3 17:14 php-fpm.pid

No, I mean the socket file. Like /run/php-fpm/php7.4-fpm.sock

How u upgrade php to 7.3?

I was in the same situation.

Issuing the commands
sudo systemctl enable php-fpm
sudo systemctl start php-fpm

moved me one step further.

I don’t have errors on /var/log/nginx/error.log

Page on browser presents the following message:

Whoops, the web server could not write required files to the filesystem.

Running the following commands will fix the issue most of the time:

Cannot write to log file: “/opt/librenms/logs/librenms.log”

Make sure it exists and is writable, or change your LOG_DIR setting.

If using SELinux you may also need:

semanage fcontext -a -t httpd_sys_rw_content_t ‘/opt/librenms/logs/librenms.log(/.*)?’

restorecon -RFv /opt/librenms/logs/librenms.log

Check your log for more details. ( /opt/librenms/logs/librenms.log )

If that doesn’t fix the issue. You can find how to get help at https://docs.librenms.org/Support.

Run ./validate.php and it will show you the commands to fix permissions.

Thanks. I ran ./validate and here is the result:

./validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 1.70.1
DB Schema | 2020_11_02_164331_add_powerstate_enum_to_vminfo (191)
PHP       | 7.4.13
Python    | 3.6.8
MySQL     | 5.5.68-MariaDB
RRDTool   | 1.4.8
SNMP      | NET-SNMP 5.7.2
OpenSSL   | 
====================================

[OK]    Composer Version: 2.0.7
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[FAIL]  Time between this server and the mysql database is off
 Mysql time 2020-12-03 17:17:14
 PHP time 2020-12-03 18:17:14

[FAIL]  MySQL Database collation is wrong: latin1 latin1_swedish_ci
        [FIX]: 
        Check https://t.libren.ms/-zdwk for info on how to fix.
[OK]    Database schema correct
[FAIL]  You have no timezone set for php.
        [FIX]: 
        http://php.net/manual/en/datetime.configuration.php#ini.date.timezone

Here is the permissions for librenms.log:

ll /opt/librenms/logs/
total 3186696
-rw-rw-r--. 1 librenms librenms    2198529 Dec  3 16:23 daily.log
-rw-rw-r--. 1 librenms librenms          0 Jun  2  2020 discovery_wrapper.log
-rw-rw-r--. 1 librenms librenms 3259143613 Dec  3 17:17 librenms.log
-rw-rw-r--. 1 librenms librenms          0 Jun  2  2020 poller_wrapper.log
-rw-rw-r--. 1 librenms librenms          0 Jun  2  2020 services_wrapper.log

on file /etc/php-fpm.d/www.conf I changed user and group from apache to librenms and I get to the login page.

sudo less /etc/php-fpm.d/www.conf
; Start a new pool named ‘www’.
; the variable $pool can be used in any directive and will be replaced by the
; pool name (‘www’ here)
[www]

; Per pool prefix
; It only applies on the following directives:
; - ‘access.log’
; - ‘slowlog’
; - ‘listen’ (unixsocket)
; - ‘chroot’
; - ‘chdir’
; - ‘php_values’
; - ‘php_admin_values’
; When not set, the global prefix (or @php_fpm_prefix@) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user’s group
; will be used.
; RPM: apache user chosen to provide access to the same directories as httpd
;user = apache
user = librenms
; RPM: Keep a group allowed to write in log dir.
;group = apache
group = librenms

Now the error is LDAP related:

PHP LDAP support missing

PHP does not support LDAP, please install or enable the PHP LDAP extension

Check your log for more details. (librenms.log)

If you need additional help, you can find how to get help at How to get help - LibreNMS Docs.