Unable to access WebUI

When I try to access my WebUI I get this error:

Here is the result of the command ./validate.php.

Component Version
LibreNMS 22.11.0 (2022-11-24T07:01:26+01:00)
DB Schema 2022_08_15_084507_add_rrd_type_to_wireless_sensors_table (248)
PHP 8.2.0
Python 3.8.10
Database MariaDB 10.3.37-MariaDB-0ubuntu0.20.04.1
RRDTool 1.7.2
SNMP 5.8
===========================================

[OK] Composer Version: 2.4.4
[OK] Dependencies up-to-date.
[FAIL] APP_KEY does not match key used to encrypt data. APP_KEY must be the same on all nodes.
[FIX]:
If you rotated APP_KEY, run lnms key:rotate to resolve.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK]
[OK] Database schema correct
[OK] MySQl and PHP time match
[FAIL] You have a different system timezone (UTC) than the php configured timezone (CET)
[FIX]:
Please correct either your system timezone or your timezone set in /etc/php/8.2/cli/php.ini.
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok

Here is the result of the command cat logs/librenms.log.
Next Illuminate\Database\QueryException: could not find driver (SQL: select * from config where (config_name = snmp.unescape) limit 1) in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(672): Illuminate\Database\Connection->runQueryCallback()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(376): Illuminate\Database\Connection->run()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2414): Illuminate\Database\Connection->select()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2402): Illuminate\Database\Query\Builder->runSelect()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2936): Illuminate\Database\Query\Builder->Illuminate\Database\Query{closure}()
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2403): Illuminate\Database\Query\Builder->onceWithColumns()
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(625): Illuminate\Database\Query\Builder->get()
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(609): Illuminate\Database\Eloquent\Builder->getModels()
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(294): Illuminate\Database\Eloquent\Builder->get()
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(474): Illuminate\Database\Eloquent\Builder->first()
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(508): Illuminate\Database\Eloquent\Builder->firstOrNew()
#11 /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(23): Illuminate\Database\Eloquent\Builder->updateOrCreate()
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2132): Illuminate\Database\Eloquent\Model->forwardCallTo()
#13 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2144): Illuminate\Database\Eloquent\Model->__call()
#14 /opt/librenms/LibreNMS/Config.php(261): Illuminate\Database\Eloquent\Model::__callStatic()
#15 /opt/librenms/LibreNMS/Config.php(473): LibreNMS\Config::persist()
#16 /opt/librenms/LibreNMS/Config.php(60): LibreNMS\Config::processConfig()
#17 /opt/librenms/app/Providers/ConfigServiceProvider.php(27): LibreNMS\Config::load()
#18 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Providers\ConfigServiceProvider->boot()
#19 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
#20 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#21 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#22 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\Container\BoundMethod::call()
#23 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(924): Illuminate\Container\Container->call()
#24 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(905): Illuminate\Foundation\Application->bootProvider()
#25 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation{closure}()
#26 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(906): array_walk()
#27 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\Foundation\Application->boot()
#28 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(237): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap()
#29 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(153): Illuminate\Foundation\Application->bootstrapWith()
#30 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(137): Illuminate\Foundation\Http\Kernel->bootstrap()
#31 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#32 /opt/librenms/html/index.php(52): Illuminate\Foundation\Http\Kernel->handle()
#33 {main}

I dont know the root cause of your problem, but first i would fix the FAILs you get in your validation.
Could be those issues are the root cause of your problem.

I just have to patch the APP_KEY problem but I can’t do anything. When I delete the old one and regenerate a new one nothing happens (even after restarting the different services and the server).

It should be known that before everything worked fine then yesterday I got the message "Error message “Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: curl, gd.” So I updated/installed these different packages, and I’m now at this point.

Can you switch back to PHP8.1? I’m quite sure that 8.1 is still the recommended version.

1 Like

Here is my solution and how I managed to solve the problem. (sorry for the English).

Following error messages “Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: curl, gd.”

Update of PHP dependencies. (see Installing LibreNMS - LibreNMS Docs).

su - librenms
./scripts/composer_wrapper.php install --no-dev
exit

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
- fgrosse/phpasn1 is locked to version v2.4.0 and an update of this package was not requested.
- fgrosse/phpasn1 v2.4.0 requires php ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 → your php version (8.2.0) does not satisfy that requirement.
Problem 2
- fgrosse/phpasn1 v2.4.0 requires php ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 → your php version (8.2.0) does not satisfy that requirement.
- web-token/jwt-core v2.2.11 requires fgrosse/phpasn1 ^2.0 → satisfiable by fgrosse/phpasn1[v2.4.0].
- web-token/jwt-core is locked to version v2.2.11 and an update of this package was not requested.

Versions of PHP8.2.X-X are installed preventing several lnms packages from working.
Removal of PHP8.2.X-X that has no business being installed.

sudo apt-get purge php8.2

Update of PHP dependencies. (see Installing LibreNMS - LibreNMS Docs).

su - librenms
./scripts/composer_wrapper.php install --no-dev
exit

LibreNMS\ComposerHelper::preInstall
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package php-cs-fixer/diff is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
@php artisan package:discover --ansi
Discovered Package: fruitcake/laravel-cors
Discovered Package: laravel-notification-channels/webpush
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: laravel/ui
Discovered Package: librenms/laravel-vue-i18n-generator
Discovered Package: mews/purifier
Discovered Package: nesbot/carbon
Discovered Package: php-flasher/flasher-laravel
Discovered Package: tightenco/ziggy
Package manifest generated successfully.
66 packages you are using are looking for funding.
Use the composer fund command to find out more!
LibreNMS\ComposerHelper::postInstall
Illuminate\Foundation\ComposerScripts::postInstall
@php artisan vue-i18n:generate --multi-locales --format=umd
@php artisan view:cache
Compiled views cleared!
Blade templates cached successfully!
@php artisan optimize
Configuration cache cleared!
Configuration cached successfully!
Route cache cleared!
Routes cached successfully!
Files cached successfully!
@php artisan config:clear
Configuration cache cleared!
scripts/dynamic_check_requirements.py || pip3 install --user -r requirements.txt || :

Following the update of the PHP dependencies, the APP_KEY has changed, not possible to recover the old one since the server is not backuped.

Generation of a new APP_KEY.

su - librenms
lnms key:rotate --generate-new-key --forgot-key
php artisan key:generate

Verification of the configuration.

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

Component Version
LibreNMS 22.11.0 (2022-11-24T07:01:26+01:00)
DB Schema Not Connected (0)
PHP 8.1.13
Python 3.8.10
Database Not Connected
RRDTool 1.7.2
SNMP 5.8
===========================================

[OK] Composer Version: 2.4.4
[OK] Dependencies up-to-date.
Could not connect to database, check logs/librenms.log.

Your PHP is missing required mysql extension(s), please install and enable.
Check the install docs for more info: docs.librenms.org/Installation/

Installation of the php MySQL extension.

sudo apt-get php8.1-mysql

Verification of the configuration.

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

Component Version
LibreNMS 22.11.0 (2022-11-24T07:01:26+01:00)
DB Schema 2022_08_15_084507_add_rrd_type_to_wireless_sensors_table (248)
PHP 8.1.13
Python 3.8.10
Database MariaDB 10.3.37-MariaDB-0ubuntu0.20.04.1
RRDTool 1.7.2
SNMP 5.8
===========================================

[OK] Composer Version: 2.4.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK]
[OK] Database schema correct
[OK] MySQl and PHP time match
[FAIL] Missing PHP extension: mbstring
[FIX]:
Please install mbstring
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok

Installation of the php mbstring extension.

sudo apt-get php8.1-mbstring -y

Verification of the configuration.

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

Component Version
LibreNMS 22.11.0 (2022-11-24T07:01:26+01:00)
DB Schema 2022_08_15_084507_add_rrd_type_to_wireless_sensors_table (248)
PHP 8.1.13
Python 3.8.10
Database MariaDB 10.3.37-MariaDB-0ubuntu0.20.04.1
RRDTool 1.7.2
SNMP 5.8
===========================================

[OK] Composer Version: 2.4.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK]
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] Active pollers found

[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok

Restart of the services :

a2dissite 000-default
a2enmod proxy_fcgi setenvif rewrite
a2ensite librenms.conf
systemctl restart apache2
systemctl restart php8.1-fpm

Attempt to access the WebUI page. OK. :white_check_mark:

1 Like

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