Total failure after php update

Hello,
I updated PHP on Ubuntu 18. Changed config files as in the install docs. Now getting the dreaded “Whoops, looks like something went wrong. Check your librenms.log” on the webpage. Both validate and daily scripts return no errors. The log file:

[2021-02-16 22:14:48] production.ERROR: syntax error, unexpected ‘)’ {“exception”:"[object] (ParseError(code: 0): syntax error, unexpected ‘)’ at /opt/librenms/vendor/laravel/framework/src/Illuminate/Testing/Concerns/TestDatabases.php:151)
[stacktrace]
#0 /opt/librenms/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile(’/opt/librenms/v…’)
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass(‘Illuminate\\Test…’)
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Testing/ParallelTestingServiceProvider.php(11): spl_autoload_call(‘Illuminate\\Test…’)
#3 /opt/librenms/vendor/composer/ClassLoader.php(444): include(’/opt/librenms/v…’)
#4 /opt/librenms/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile(’/opt/librenms/v…’)
#5 [internal function]: Composer\Autoload\ClassLoader->loadClass(‘Illuminate\\Test…’)
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(720): spl_autoload_call(‘Illuminate\\Test…’)
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(654): Illuminate\Foundation\Application->resolveProvider(‘Illuminate\\Test…’)
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/AggregateServiceProvider.php(31): Illuminate\Foundation\Application->register(‘Illuminate\\Test…’)
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php(44): Illuminate\Support\AggregateServiceProvider->register()
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(657): Illuminate\Foundation\Providers\FoundationServiceProvider->register()
#11 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(75): Illuminate\Foundation\Application->register(Object(Illuminate\Foundation\Providers\FoundationServiceProvider))
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(634): Illuminate\Foundation\ProviderRepository->load(Array)
#13 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php(17): Illuminate\Foundation\Application->registerConfiguredProviders()
#14 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(237): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(App\Application))
#15 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(152): Illuminate\Foundation\Application->bootstrapWith(Array)
#16 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(136): Illuminate\Foundation\Http\Kernel->bootstrap()
#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#18 /opt/librenms/html/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#19 {main}
"}
/opt/librenms/discovery.php new 2021-02-16 17:15:04 - 0 devices discovered in 1.618 secs
/opt/librenms/poller.php 5 2021-02-16 17:15:05 - 1 devices polled in 1.692 secs
/opt/librenms/poller.php 44 2021-02-16 17:15:12 - 1 devices polled in 8.505 secs

Note that the time before #0 line is UTC. I double-checked the PHP config files, they have the correct timezone in them. Please help.

Delete vendor folder and run ./scripts/composer_wrapper.php install --no-dev

@Jellyfrog, thanks for your advice. I renamed the vendor folder, and ran the script. It recreated the folder, exited without errors, but the GUI still has nothing but the “Whoops” message.

Ok so I’m guessing you forgot to change your webserver settings to point to your new php version.
So uninstall the old php versions if possible and reconfigure your webserver, check https://docs.librenms.org/Installation/Install-LibreNMS/#configure-web-server for more info.

Hello everyone,

First post, yay!

I’m experiencing the same upgrading between 1.70.1 to 21.2.0.

LibreNMS is an autodiscovering PHP/MySQL-based network monitoring system

Version [1.70.1 - Wed Dec 02 2020 15:39:06 GMT+0100]
Database Schema 2020_11_02_164331_add_powerstate_enum_to_vminfo (191)
Web Server Apache/2.4.29 (Ubuntu)
PHP 7.2.24-0ubuntu0.18.04.7
Python 3.6.9
MySQL 10.1.47-MariaDB-0ubuntu0.18.04.1
Laravel 8.11.2
RRDtool 1.7.0

First I was thinking the same with the PHP version : I had a timezone gap, but even when I correct this into the PHP.ini (both in CLI and APACHE2) I still getting the error.
So I tried without upgrading to 7.4 and got the same error.

I also try to remove the folder “vendor” entirely and reinject everything with this

./scripts/composer_wrapper.php install --no-dev

Without any success :frowning:

My opinion is something get wrong from updating in this TestDatabases.php at line 151

[2021-02-18 15:28:53] production.ERROR: syntax error, unexpected ‘)’ {“exception”:"[object] (ParseError(code: 0): syntax error, unexpected ‘)’ at /opt/librenms/vendor/laravel/framework/src/Illuminate/Testing/Concerns/TestDatabases.php:151)
[stacktrace]
#0 /opt/librenms/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile(’/opt/librenms/v…’)
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass(‘Illuminate\\Test…’)
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Testing/ParallelTestingServiceProvider.php(11): spl_autoload_call(‘Illuminate\\Test…’)
#3 /opt/librenms/vendor/composer/ClassLoader.php(444): include(’/opt/librenms/v…’)
#4 /opt/librenms/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile(’/opt/librenms/v…’)
#5 [internal function]: Composer\Autoload\ClassLoader->loadClass(‘Illuminate\\Test…’)
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(720): spl_autoload_call(‘Illuminate\\Test…’)
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(654): Illuminate\Foundation\Application->resolveProvider(‘Illuminate\\Test…’)
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/AggregateServiceProvider.php(31): Illuminate\Foundation\Application->register(‘Illuminate\\Test…’)
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php(44): Illuminate\Support\AggregateServiceProvider->register()
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(657): Illuminate\Foundation\Providers\FoundationServiceProvider->register()
#11 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(75): Illuminate\Foundation\Application->register(Object(Illuminate\Foundation\Providers\FoundationServiceProvider))
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(634): Illuminate\Foundation\ProviderRepository->load(Array)
#13 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php(17): Illuminate\Foundation\Application->registerConfiguredProviders()
#14 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(237): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(App\Application))
#15 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(152): Illuminate\Foundation\Application->bootstrapWith(Array)
#16 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(136): Illuminate\Foundation\Http\Kernel->bootstrap()
#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#18 /opt/librenms/html/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#19 {main}
"}

Thank you !

Thanks, I got it working somehow. I uninstalled old php with apt remove php-7.2* After that the web interface would give me the 502 “Bad Gateway” message. My web server turned out to be NGINX. The error log complained that it couldn’t find php 7.2 Eventually I found fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; line in /etc/nginx/conf.d/librenms.conf. Changing it to 7.4 did the trick. Thanks again @Jellyfrog !

Hello all,

I confirm what stopeject said.

I think, php-7.4 is mandatory, so remove everything < php-7.4 before upgrading.
Then upgrade with daily.sh and gem if you have some extra plugins.

You can close the topic !

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