Clean Install on LibreNMS not Workng

librenms@LibreNMS:~$ php validate.php

Component Version
LibreNMS 25.4.0-48-g21c3743ae (2025-04-28T07:59:47+00:00)
DB Schema 2025_04_15_122034_laravel_11_fix_types (332)
PHP 8.4.6
Python 3.12.3
Database MariaDB 10.11.11-MariaDB-0ubuntu0.24.04.2
RRDTool 1.7.2
SNMP 5.9.4.pre2
===========================================

[OK] Composer Version: 2.8.8
[OK] Dependencies up-to-date.
[WARN] You have no devices.
[FIX]:
Consider adding a device such as localhost: /addhost
[OK] Database Connected
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQL and PHP time match
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok

Tried on Ubuntu 24.04.2 LTS several times following Installing LibreNMS - LibreNMS Docs
Everything is fine until the step to make a first connection via WWW:
a) need to add database password to the ,env file
b) run ./lnms migrate as hinted on the GUI page
c) tried updating PHP to 8.4 but no change
d) tried Debian12 too but again, no difference
e) the log file now gives me the following message every time I try to access from the GUI:
[2025-04-28T15:37:41][ERROR] There is no role named admin for guard web. {“exception”:“[object] (Spatie\Permission\Exceptions\RoleDoesNotExist(code: 0): There is no role named admin for guard web. at /opt/librenms/vendor/spatie/laravel-permission/src/Exceptions/RoleDoesNotExist.php:11)”}

Anyone got any ideas what I can try next? Have I missed something? This is a completely fresh installation carried out today (28.4.25 and yesterday.
THANKS

I do have the exact same problem. Fresh install ob Ubuntu 24.04.2 LTS, followed the install docs, but no luck. DB Tables are created but they are empty.
If you open /install in browser it says SQL credentials are missing. If you add them to the .env file, the DB connection works, installer forwards you to /install/checks but welcomes you with the error message:

Whoops, looks like something went wrong. Check your librenms.log.

Log shows the same error as for @gagoo:
[2025-04-28T22:35:27][ERROR] There is no role named admin for guard web. {“exception”:“[object] (Spatie\Permission\Exceptions\RoleDoesNotExist(code: 0):There is no role named admin for guard web. at /opt/librenms/vendor/spatie/laravel-permission/src/Exceptions/RoleDoesNotExist.php:11)”}

Same issue here - been a few months since I’ve installed, but it’s something in the installer I feel - can’t pinpoint a change that would be relevant for it.

24.04 as per instructions, first hit on WebUI /install gets: SQLSTATE[HY000] [1045] Access denied for user 'librenms'@'localhost' (using password: NO)

The .env file that it generates has the DB creds commented out as you’d expect.

If I create a new user with no password, the error is then just: SQLSTATE[HY000] [1045] Access denied for user 'librenms'@'localhost'

If I create a normal user with password and update the .env file, it gives: mysql install SQLSTATE[42S02]: Base table or view not found: 1146 Table 'librenms.migrations' doesn't exist

Same issue here. Just started last week. Symptoms are: fresh install, browse to the /install page, and receive “SQLSTATE[HY000] [1045] Access denied for user ‘librenms’@‘localhost’ (using password: NO)”.

If I update the env file and reload the /install page, I then receive a different error - " Database inconsistencies found during a database error, please fix to continue.

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘librenms.migrations’ doesn’t exist (Connection: mysql, SQL: select 1 from migrations limit 1)

Your database is out of date!

./lnms migrate"

Running ./lnms migrate seems to create the database, but reloading the install page then shows “Check your log for more details. (librenms.log)”

librenms.log says:

[2025-04-28T19:36:31][ERROR] There is no role named admin for guard web. {“exception”:“[object] (Spatie\Permission\Exceptions\RoleDoesNotExist(code: 0): There is no role named admin for guard web. at /opt/librenms/vendor/spatie/laravel-permission/src/Exceptions/RoleDoesNotExist.php:11)”}

Any help or suggestions appreciated.

This has narrowed it down to a laravel change potentially: Web Installer fails on a database connection · Issue #17546 · librenms/librenms · GitHub

As a workaround:

If you checkout a previous release (easiest) like: git checkout 25.3.0 then rerun the composer_wrapper line from the install doco (./scripts/composer_wrapper.php install --no-dev), and delete the .env file, the installer comes good.

Once install is done, you can then git checkout master and rerun ./scripts/composer_wrapper.php install --no-dev then run ./daily.sh and it should be back to normal.

Hi,
thanks for your help, this did the trick for me:
cd /opt/librenms
su - librenms
git checkout 25.3.0
./scripts/composer_wrapper.php install --no-dev
rm .env
exit

After this steps the installer claims that there is unexpected data, etc. - connect to mysql and drop database with wrong contents and create fresh, empty database:

MariaDB [(none)]> drop database librenms;
Query OK, 159 rows affected (0.092 sec)

MariaDB [(none)]> CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> quit
Bye

Run the composer again because the installer returned an unexpected error message (because of the DB content):
su - librenms
./scripts/composer_wrapper.php install --no-dev
exit

Now the installer works and Librenms is already polling data from first SNMP hosts :slight_smile:
Thank you!

PS: Update per ./daily.sh also worked, but came back with some messages:

$ ./daily.sh
Previous HEAD position was 92a490aa3 Changelog and version bump for 25.3.0 (#17273)
Switched to branch ‘master’
Your branch is up to date with ‘origin/master’.
Updating to latest codebase OK
PHP Fatal error: Uncaught BadMethodCallException: Method Illuminate\Foundation\Application::configure does not exist. in /opt/librenms/vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:86
Stack trace:
#0 /opt/librenms/bootstrap/app.php(7): Illuminate\Foundation\Application::__callStatic()
#1 /opt/librenms/LibreNMS/Util/Laravel.php(43): require_once(‘…’)
#2 /opt/librenms/includes/init.php(90): LibreNMS\Util\Laravel::bootCli()
#3 /opt/librenms/daily.php(42): require(‘…’)
#4 {main}
thrown in /opt/librenms/vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php on line 86
PHP Fatal error: Uncaught BadMethodCallException: Method Illuminate\Foundation\Application::configure does not exist. in /opt/librenms/vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:86
Stack trace:
#0 /opt/librenms/bootstrap/app.php(7): Illuminate\Foundation\Application::__callStatic()
#1 /opt/librenms/LibreNMS/Util/Laravel.php(43): require_once(‘…’)
#2 /opt/librenms/includes/init.php(90): LibreNMS\Util\Laravel::bootCli()
#3 /opt/librenms/daily.php(42): require(‘…’)
#4 {main}
thrown in /opt/librenms/vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php on line 86
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

Did you definitely run the composer update before daily after switching back to master?

Oh, you are right, I did NOT change to master and did NOT re-run composer before daily. I did it now and now there is no more error:

$ git checkout master
Already on ‘master’
Your branch is up to date with ‘origin/master’.

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

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 influxdb/influxdb-php is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
@php artisan package:discover --ansi

INFO Discovering packages.

laravel-notification-channels/webpush … DONE
laravel/socialite … DONE
laravel/tinker … DONE
laravel/ui … DONE
librenms/laravel-vue-i18n-generator … DONE
mews/purifier … DONE
nesbot/carbon … DONE
nunomaduro/termwind … DONE
spatie/laravel-ignition … DONE
spatie/laravel-permission … DONE
tightenco/ziggy … DONE

72 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

INFO Blade templates cached successfully.

@php artisan optimize

INFO Caching framework bootstrap, configuration, and metadata.

config … 149.60ms DONE
events … 1.69ms DONE
routes … 48.97ms DONE
views … 143.15ms DONE

@php artisan config:clear

INFO Configuration cache cleared successfully.

scripts/dynamic_check_requirements.py || pip3 install --user -r requirements.txt || :
/opt/librenms/scripts/dynamic_check_requirements.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See Package Discovery and Resource Access using pkg_resources - setuptools 80.0.0.post20250427 documentation
import pkg_resources

$ ./daily.sh
Clearing caches OK
Updating to latest codebase OK
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

For now

@rhinoau Has fixed it, big thanks to him

1 Like

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