Error on adding a New Device Group

The output of ./validate.php

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

Component Version
LibreNMS 1.55
DB Schema 2019_07_09_150217_update_users_widgets_settings (140)
PHP 7.2.19-0ubuntu0.18.04.2
MySQL 10.1.41-MariaDB-0ubuntu0.18.04.1
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3
====================================

[OK] Composer Version: 1.9.0
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

The output of ./daily.sh
librenms@librenms:~$ ./daily.sh
Updating to latest release OK
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

When I click on Devices->Manage Groups->New Device Group, the following error appears

Excerpt from the librenms.log

[2019-09-03 15:50:42] production.ERROR: file_put_contents(/opt/librenms/cache/devices_relationships.cache): failed to open stream: Permission denied {ā€œuserIdā€:1,ā€œexceptionā€:"[object] (ErrorException(code: 0): file_put_contents(/opt/librenms/cache/devices_relationships.cache): failed to open stream: Permission denied at /opt/librenms/LibreNMS/DB/Schema.php:173)
[stacktrace]
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, ā€˜file_put_contenā€¦ā€™, ā€˜/opt/librenms/Lā€¦ā€™, 173, Array)
#1 /opt/librenms/LibreNMS/DB/Schema.php(173): file_put_contents(ā€˜/opt/librenms/cā€¦ā€™, ā€˜a:2:{s:7:"versiā€¦ā€™)
#2 /opt/librenms/LibreNMS/Alerting/QueryBuilderFilter.php(92): LibreNMS\DB\Schema->getAllRelationshipPaths()
#3 /opt/librenms/LibreNMS/Alerting/QueryBuilderFilter.php(57): LibreNMS\Alerting\QueryBuilderFilter->generateTableFilter()
ā€¦

The file /opt/librenms/cache/devices_relationships.cache does not exist.

A run of the ā€œValidate Configā€ option in the WebUI does not show any permission problems.

This is a new install, only 3 days old and Iā€™m a newbie with librenms.

I had to manually add a cronjob to fix the permissions under /opt/librenms with setfacl because rrd files for newly added devices wouldnā€™t be created with proper permissions. There are multiple threads here regarding this specific problem but I donā€™t think it is connected to my actual New-Device-Group-problem.

Any help greatly appreciated

Welcome! Try run through all the troubleshooting steps in this thread

#Two Issues after fresh install

librenms user was already a member of www-data group.

chmod g+w /opt/librenms/cache fixed the problem.

Thx a lot

2 Likes