Webgui user lost permissions?

Hi,

Today no devices or anything is showing up in the libre webgui. On the settings icon the only thing I can see there is “About LibreNMS”. No settings or anything.
I can see my own user settings but at the end of that page it says Roles “No roles” and Devices Permission “No access”.
It seems like the user have lost the access?

Look at the screenshot ff the personal user settings showing no access / no roles in the picture 1.

And here is the drop down of the setting meny. As you can see it’s only the “About libreNMS” and not all the settings I need to access. See pic number 2.

I can see that devices are still there when looking at the logs in CLI:
"/opt/librenms/poller.php 103 2023-08-28 10:52:46 - 1 devices polled in 1.778 secs
/opt/librenms/poller.php 118 2023-08-28 10:52:46 - 1 devices polled in 1.921 secs
/opt/librenms/poller.php 93 2023-08-28 10:52:46 - 1 devices polled in 1.766 secs
"

Here is the output of the validate-script:

librenms@STSLIBNMS02:~$ ./validate.php

Component Version
LibreNMS 23.8.2-11-g2cd207028 (2023-08-28T07:13:40+02:00)
DB Schema 2023_08_02_120455_vendor_ouis_unique_index (257)
PHP 8.1.12
Python 3.8.10
Database MariaDB 10.3.38-MariaDB-0ubuntu0.20.04.1
RRDTool 1.7.2
SNMP 5.8
===========================================

[OK] Composer Version: 2.5.8
[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] Database and column collations are correct
[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] rrdtool version ok
[OK] Connected to rrdcached

Everything is OK from the validation script.

I have tried to create a new user with lnms user:add but always getting error. See pic number 3.

Anybody got any ideas? :slight_smile:

Here is the pictures. (Couldn’t add multiple pictures as a new user).

I have the same problem. Did a new installation on Debian and Ubuntu with same result.

librenms@nms-xxxxxxxxxx:~$ lnms user:add -p test -r admin test
The selected role is invalid.

The default user after installation has also no roles:

Roles

No roles!

Device Permissions

No access!

Update. Upon checking the DB on an older version there seems to be column level “(level tinyint(4)” is missing int the latest version of librenms.

Table: users
Columns:
user_id int(10) UN AI PK
auth_type varchar(32)
auth_id varchar(255)
username varchar(255)
password varchar(255)
realname varchar(64)
email varchar(64)
descr char(30)
level tinyint(4)
can_modify_passwd tinyint(1)
created_at timestamp
updated_at timestamp
remember_token varchar(100)
enabled tinyint(1)

You might have had unlucky enough timing to find a short lived bug. Try:

./daily.sh
lnms db:seed --force
lnms user:add newadmin -r admin
log in to the webui and add roles back to users missing roles under <gear>->Manage Users

Some users may only need to run lnms db:seed --class='Database\Seeders\RolesSeeder' and lnms tinker --execute='Bouncer::refresh()'

3 Likes

This worked for me as I was having same issue, had to run daily.sh a couple times, only myself and a couple other user lost roles everyone else was fine. Thanks for the fix.

I had the same exact problem… I ended up restoring my VM/system to an earlier time and was back up and running.

I then decided to run the daily.sh and got some errors… Are these related to your fix? Should I run those same commands to fix that php error?

Thank you! I ran into the same issue & this just fixed my issue.

A post was split to a new topic: Install fails

Thank you so much! This solution made me able to login with the new admin and att the roles back.

1 Like

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

If you want to check that your roles are correct, run lnms tinker followed by

Bouncer::role()->with('abilities')->get()->map(fn($role) => $role->name.'='.$role->abilities->pluck('name')->implode(','))->all()

It should output:

= [
    "admin=*",
    "user=",
    "global-read=viewAny",
  ]