LibreNMS fails to start or update since yesterday

Output of ./validate.php

[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

Output of ./daily.sh

[librenms@librenms ~]$ ./daily.sh

In AppServiceProvider.php line 43:

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


Updating SQL-Schema                                OK
Cleaning up DB                                     OK

In AppServiceProvider.php line 43:

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

Not sure what has happened. Was working fine last night then woke up to the service failed. Could this have been an issue with an update? Any hints on how to fix this. Unable to login to web interface or do anything. It tells me to check librenms.log which has the following.

/opt/librenms/poller.php 3 2020-12-02 00:11:43 - 1 devices polled in 1.157 secs
/opt/librenms/poller.php 73 2020-12-02 00:11:43 - 1 devices polled in 1.118 secs
/opt/librenms/discovery.php new 2020-12-02 00:15:01 - 0 devices discovered in 0.014 secs
[2020-12-02 00:15:08] production.ERROR: Call to undefined method Illuminate\Pagination\Paginator::useBootstrap() {"exception":"[object] (Error(code: 0): Call to undefined method Illuminate\\Pagination\\Paginator::useBootstrap() at /opt/librenms/app/Providers/AppServiceProvider.php:43)
[stacktrace]
#0 [internal function]: App\\Providers\\AppServiceProvider->boot()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): call_user_func_array(Array, Array)
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(37): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(95): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(39): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(App\\Application), Array, Object(Closure))
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(596): Illuminate\\Container\\BoundMethod::call(Object(App\\Application), Array, Array, NULL)
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(867): Illuminate\\Container\\Container->call(Array)
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(850): Illuminate\\Foundation\\Application->bootProvider(Object(App\\Providers\\AppServiceProvider))
#8 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}(Object(App\\Providers\\AppServiceProvider), 23)
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(851): array_walk(Array, Object(Closure))
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot()
#11 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(230): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap(Object(App\\Application))
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(310): Illuminate\\Foundation\\Application->bootstrapWith(Array)
#13 /opt/librenms/LibreNMS/Util/Laravel.php(46): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
#14 /opt/librenms/includes/init.php(91): LibreNMS\\Util\\Laravel::bootCli()
#15 /opt/librenms/daily.php(17): require('/opt/librenms/i...')
#16 {main}
"}

Thank you

I imagine this is because my PHP version is 7.2.27?

Should this solve my issue? How To Install PHP 7.4 on CentOS 7 | ComputingForGeeks

Found more in daily.log.

Previous HEAD position was 0ac05fd... Bump version to 1.69
HEAD is now at 84c08f4... Bump version to 1.70.0
Returned: 0
Unsupported PHP version, switched to php72 branch.
error: pathspec 'php72' did not match any file(s) known to git.
Returned: 1
Updating Composer packages
> LibreNMS\ComposerHelper::preInstall
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - Root composer.json requires php ^7.3 but your php version (7.2.27) does not satisfy that requirement.
  Problem 2
    - doctrine/dbal is locked to version 2.12.0 and an update of this package was not requested.
    - doctrine/dbal 2.12.0 requires php ^7.3 || ^8 -> your php version (7.2.27) does not satisfy that requirement.
  Problem 3
    - laravel/framework is locked to version v8.11.2 and an update of this package was not requested.
    - laravel/framework v8.11.2 requires php ^7.3 -> your php version (7.2.27) does not satisfy that requirement.
  Problem 4
    - laravel/ui is locked to version v3.0.0 and an update of this package was not requested.
    - laravel/ui v3.0.0 requires php ^7.3 -> your php version (7.2.27) does not satisfy that requirement.
  Problem 5
    - laravel/framework v8.11.2 requires php ^7.3 -> your php version (7.2.27) does not satisfy that requirement.
    - wpb/string-blade-compiler 6.0.2 requires laravel/framework ^6.0|^7.0|^8.0 -> satisfiable by laravel/framework[v8.11.2].
    - wpb/string-blade-compiler is locked to version 6.0.2 and an update of this package was not requested.
Returned: 2
Unsupported PHP version, switched to php72 branch.
error: pathspec 'php72' did not match any file(s) known to git.
Returned: 1
Updated from 1.69 to 1.70.0

Returned: 0
Updating SQL-Schema

In AppServiceProvider.php line 43:

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

Returned: 0
Updating submodules

Returned: 0
Cleaning up DB

In AppServiceProvider.php line 43:

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

Gonna take a snapshot then update to 7.4 php and then run daily again and see what happens.

Yes. Mine was dead this morning too.

Trying to follow that guide to install PHP 7.4 brings the following errors.

--> Finished Dependency Resolution
Error: Package: composer-1.10.17-1.el7.noarch (epel)
           Requires: php-zip
           Removing: php72w-common-7.2.27-1.w7.x86_64 (@webtatic)
               php-zip
           Obsoleted By: php-common-7.4.13-1.el7.remi.x86_64 (remi-php74)
               Not found
           Updated By: php72w-common-7.2.34-1.w7.x86_64 (webtatic)
               php-zip
           Available: php-common-5.4.16-48.el7.x86_64 (base)
               php-zip
           Available: php-pecl-zip-1.19.1-1.el7.remi.7.4.x86_64 (remi-php74)
               php-zip = 1:1.19.1-1.el7.remi.7.4
           Available: php-pecl-zip-1.19.2-1.el7.remi.7.4.x86_64 (remi-php74)
               php-zip = 1:1.19.2-1.el7.remi.7.4
           Available: php55w-common-5.5.38-1.w7.x86_64 (webtatic)
               php-zip
           Available: php56w-common-5.6.40-1.w7.x86_64 (webtatic)
               php-zip
           Available: php70w-common-7.0.33-1.w7.x86_64 (webtatic)
               php-zip
           Available: php71w-common-7.1.26-1.w7.x86_64 (webtatic)
               php-zip
           Available: php71w-common-7.1.27-1.w7.x86_64 (webtatic)
               php-zip
           Available: php71w-common-7.1.28-1.w7.x86_64 (webtatic)
               php-zip
           Available: php71w-common-7.1.29-1.w7.x86_64 (webtatic)
               php-zip
           Available: php71w-common-7.1.30-1.w7.x86_64 (webtatic)
               php-zip
           Available: php71w-common-7.1.31-1.w7.x86_64 (webtatic)
               php-zip
           Available: php71w-common-7.1.32-1.w7.x86_64 (webtatic)
               php-zip
           Available: php71w-common-7.1.33-1.w7.x86_64 (webtatic)
               php-zip
           Available: php72w-common-7.2.14-1.w7.x86_64 (webtatic)
               php-zip
           Available: php72w-common-7.2.16-1.w7.x86_64 (webtatic)
               php-zip
           Available: php72w-common-7.2.17-1.w7.x86_64 (webtatic)
               php-zip
           Available: php72w-common-7.2.19-1.w7.x86_64 (webtatic)
               php-zip
           Available: php72w-common-7.2.21-1.w7.x86_64 (webtatic)
               php-zip
           Available: php72w-common-7.2.22-1.w7.x86_64 (webtatic)
               php-zip
           Available: php72w-common-7.2.24-1.w7.x86_64 (webtatic)
               php-zip
           Available: php-common-7.4.12-1.el7.remi.x86_64 (remi-php74)
               Not found
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Anyone know what I should do to resolve this?

Yeah I’m stuck. It’s failing because of php-zip dependencies on composer-1.10.17 but I can’t figure out how to get it to update :frowning:

Followed CentOS 7.9 Core PHP 7.2 to 7.4 Upgrade - Help - LibreNMS Community and php 7.4.13 is installed now, but when I try to run daily.sh it still returns the following error.

In AppServiceProvider.php line 43:

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

1 Like

Ran ./validate.php and it came back with the following error

[librenms@librenms ~]$ ./validate.php
PHP Notice: Undefined index: openssl_ver in /opt/librenms/validate.php on line 167

Notice: Undefined index: openssl_ver in /opt/librenms/validate.php on line 167

Component Version
LibreNMS 1.70.0
DB Schema Not Connected (0)
PHP 7.4.13
Python 3.6.8
MySQL ?
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2
OpenSSL

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

[OK] Composer Version: 2.0.7
[FAIL] Missing dependencies!
[FIX]:
/opt/librenms/scripts/composer_wrapper.php install --no-dev
Dependencies:
graham-campbell/result-type
symfony/polyfill-intl-grapheme
symfony/string
psr/http-client
nunomaduro/laravel-console-summary
[librenms@librenms ~]$

Then Ran

[librenms@librenms ~]$ /opt/librenms/scripts/composer_wrapper.php install --no-dev

Then Ran ./daily.sh

and everything seemed to pass.

However I get a ngix 502 bad gateway now when trying to load the webpage.

[librenms@librenms ~]$ ./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-02 10:49:28
PHP time 2020-12-02 18:49:28

[FAIL] Database: incorrect column (notifications/datetime)
[FAIL] Database: incorrect column (users/created_at)
[FAIL] We have detected that your database schema may be wrong, please report the following to us on Discord (https://t.libren.ms/discord) or the community site (https://t.libren.ms/5gscd):
[FIX]:
Run the following SQL statements to fix.
SQL Statements:
ALTER TABLE notifications CHANGE datetime datetime timestamp NOT NULL DEFAULT ‘1970-01-02 00:00:00’ ;
ALTER TABLE users CHANGE created_at created_at timestamp NOT NULL DEFAULT ‘1970-01-02 00:00:01’ ;
[FAIL] You have no timezone set for php.
[FIX]:
http://php.net/manual/en/datetime.configuration.php#ini.date.timezone
[WARN] Global lnms shortcut not installed. lnms command must be run with full path
[FIX]:
sudo ln -s /opt/librenms/lnms /usr/local/bin/lnms
[WARN] Bash completion not installed. lnms command tab completion unavailable.
[FIX]:
sudo cp /opt/librenms/misc/lnms-completion.bash /etc/bash_completion.d/
[WARN] Log rotation not enabled, could cause disk space issues
[FIX]:
sudo cp /opt/librenms/misc/librenms.logrotate /etc/logrotate.d/librenms

I’m almost fixed here.

[librenms@librenms ~]$ ./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] Database: incorrect column (notifications/datetime)
[FAIL] Database: incorrect column (users/created_at)
[FAIL] We have detected that your database schema may be wrong, please report the following to us on Discord (https://t.libren.ms/discord) or the community site (https://t.libren.ms/5gscd):
[FIX]:
Run the following SQL statements to fix.
SQL Statements:
ALTER TABLE notifications CHANGE datetime datetime timestamp NOT NULL DEFAULT ‘1970-01-02 00:00:00’ ;
ALTER TABLE users CHANGE created_at created_at timestamp NOT NULL DEFAULT ‘1970-01-02 00:00:01’ ;
[librenms@librenms ~]$
[librenms@librenms ~]$
[librenms@librenms ~]$ ./daily.sh
Fetching new release information OK
Updating to latest release OK
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

Now I’m just stuck with that 502 bad gateway error from nginx.

Check your nginx log files for more information. See this similar question:

That is definitely the issue. Just unsure of how to fix it.

2020/12/02 12:14:47 [crit] 18618#0: *1 connect() to unix:/var/run/php-fpm/php7.4-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 1, server: librenms.example.com, request: “GET / HTTP/1.1”, upstream: "fastcgi://unix:/var/run/php-fpm/php7.4-fpm.soc$

I modified librenms.conf to php7.4-fpm.sock and restarted nginx but no dice.

If I change librenms.conf to 127.0.0.1:9000 as what’s in www.conf I get the following.

2020/12/02 12:19:31 [error] 9970#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.1.1.1, server: librenms.example.com, request: “GET / HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “librenms”

Did you restart fpm? You can find the service name like so:

# systemctl list-units | grep 'fpm'
php73-php-fpm.service loaded active running

Then restart using the name of the service:

# systemctl restart php73-php-fpm.service

2 Likes

Thanks for responding.

I tried looking for that service but it does not exist on the system.

Checked both files, everything matches. Still getting the error in nginx.

2020/12/02 13:26:03 [error] 22853#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.88.88.3, server: librenms.example.com, request: “GET / HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “librenms”

Hey rob,

For some reason the service was not created after I upgraded php to version 7.4.

After I re-enabled the service and started it then restarted nginx everything started fine and I was back online.

Seems like something went wrong with the upgrade script though. Should have halted right away when php 7.2 was detected.

My issue is now solved.

I had restart php-fpm.service and execute the ./validate.php is failed (Do not run validate.php as root), and see the /var/log/nginx/error.log has the “unix:/run/php-fpm-librenms.sock failed error”, have anyone to help me to resolve it? thx.


Change your user to librenms

su librenms

And then run validate.php

2 Likes

thx, it had resolved.

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