LibreNMS stopped working

This morning My LibreNMS server stopped working.

I get this error when i try to run daily.sh

[librenms- librenms]$ ./daily.sh
/opt/librenms/.env: line 6: LCgpzkEm433AibmN: command not found

In AppServiceProvider.php line 43:

Call to undefined method Illuminate\Pagination\Paginator::useBootstrap()

/opt/librenms/.env: line 6: LCgpzkEm433AibmN: command not found
Updating SQL-Schema OK
Cleaning up DB OK

In AppServiceProvider.php line 43:

Call to undefined method Illuminate\Pagination\Paginator::useBootstrap()

validate.php gives this error.

[librenms- librenms]$ ./validate.php

In AppServiceProvider.php line 43:

Call to undefined method Illuminate\Pagination\Paginator::useBootstrap()

PHP Fatal error: Uncaught ErrorException: Undefined index: openssl_ver in /opt/librenms/validate.php:167
Stack trace:
#0 /opt/librenms/validate.php(167): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, ‘Undefined index…’, ‘/opt/librenms/v…’, 167, Array)
#1 /opt/librenms/validate.php(84): print_header(Array)
#2 [internal function]: {closure}()
#3 {main}
thrown in /opt/librenms/validate.php on line 167

I havn’t been able to find a way to resolve, please advice what to try.

I have exact the same issue.

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

[[email protected] php-fpm]# pwd
/var/run/php-fpm

[[email protected] 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.