Admin user roles

Server ran out of disk space so we increased the VM storage and resized partion etc and was succesful.Logged into libre check the oxidized tab and all was working copy pasted to notepad all devices I needed. Then tried to add another user via the gui and was presented with 403 unauthorized.
Checked the roles of the current accout and had admin role assigned.
Ran ./daily.sh and had these errors but ./validate.php reported all is good.

./daily.sh
Updating to latest codebase OK
PHP Fatal error: Trait “Silber\Bouncer\Database\HasRolesAndAbilities” not found in /opt/librenms/app/Models/User.php on line 22

In User.php line 22:

Trait “Silber\Bouncer\Database\HasRolesAndAbilities” not found

PHP Fatal error: Trait “Silber\Bouncer\Database\HasRolesAndAbilities” not found in /opt/librenms/app/Models/User.php on line 22

In User.php line 22:

Trait “Silber\Bouncer\Database\HasRolesAndAbilities” not found

I reboot server and now the only user accoutn has now roles and there is also no devices are in libre

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

Component Version
LibreNMS 23.8.2-11-g2cd207028 (2023-08-28T07:13:40+02:00)
DB Schema 2023_06_18_201914_migrate_level_to_roles (257)
PHP 8.1.2-1ubuntu2.14
Python 3.10.12
Database MariaDB 10.6.12-MariaDB-0ubuntu0.22.04.1
RRDTool 1.7.2
SNMP 5.9.1
===========================================

[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] rrd_dir is writable
[OK] rrdtool version ok

I do see this in the librenms.log

SQLSTATE[HY000]: General error: 1021 Disk full (/tmp/#sql-temptable-2a0-91-9.MAI); waiting for someone to free some space… (errno: 28 “No space left on device”) (Connection: mysql, SQL: SELECT D.,S.,attrPDOException: SQLSTATE[HY000] [2002] No such file or directory in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:65
SQLSTATE[HY000]: General error: 1021 Disk full (/tmp/#sql-temptable-298-8b-f.MAI); waiting for someone to free some space… (errno: 28 “No space left on device”) (Connection: mysql, SQL: SELECT D.,S.,attrib_value FROM devices AS D INNER JOIN services AS S ON S.device_id = D.device_id AND D.disabled = 0 LEFT JOIN devices_attribs as A ON D.device_id = A.device_id AND A.attrib_type = “override_icmp_disable” ORDER by D.device_id DESC;) (Connection: dbFacile, SQL: SELECT D.,S.,attrib_value FROM devices AS D INNER JOIN services AS S ON S.device_id = D.device_id AND D.disabled = 0 LEFT JOIN devices_attribs as A ON D.device_id = A.device_id AND A.attrib_type = “override_icmp_disable” ORDER by D.device_id DESC;)#0 /opt/librenms/check-services.php(57): dbFetchRows()

Filesystem Size Used Avail Use% Mounted on
tmpfs 787M 1.1M 786M 1% /run
/dev/mapper/ubuntu–vg-ubuntu–lv 175G 37G 130G 22% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda2 2.0G 286M 1.6G 16% /boot
tmpfs 787M 4.0K 787M 1% /run/user/998

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 lnms db:seed --class='Database\Seeders\RolesSeeder' and lnms tinker --execute='Bouncer::refresh()'

1 Like

I ran Ubuntu (22.04) updates and appeared to no longer have admin access…no dashboard data, no longer had management options, etc., and your suggestion resolved my issue. Thanks murrant!

murrant’s fixed worked for use

I had the same issue this morning. murrant’s fix worked for me as well.
I can confirm that my nodes did run automatic updates/upgrades last night…

@murrant Thank you for providing the correct advice. It is now able to run smoothly.
lnms user:add newadmin -r admin

1 Like

Thanks for this post explaining the fix. It was affecting us as well. Changed to the monthly release to make the higher ups happy :slight_smile:

1 Like

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