Recommended permissions fixes are ignored [Solved]

I ran into a what was probably an update issue and solved it with Pedro_Rodrigues’s post in this thread; Updated Librenms VM, now cant access WebUI.

I ran ./daily.sh, but saw a few permission complaints in the browser (and a suggested fix) after restarting. I just ran the commands expecting resolution.
CentOS Linux release 7.5.1804 (Core)

./validate.sh showed a few other permissions errors, and I “did the needful”;
[FIX] chown -R librenms:librenms /opt/librenms
https://pastebin.com/zFMD1x3G

I got a few new permissions errors, took action and it looked good in the shell so I figured all was good;
-bash-4.2$ ls -al /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/storage/framework/sessions
https://pastebin.com/zQKqeV7G

But I’m still getting these errors;
Error: bootstrap/cache, storage, storage/framework/sessions, storage/framework/views, storage/framework/cache not writable! Run these commands as root on your LibreNMS server to fix:
even after running the recommended commands;
https://pastebin.com/SmJsaLMk

This seems to be an easy fix but something’s not working. Has anyone run into this?

I believe these files may need to be writable by www-data, apache or similar user

@Daniel_Schmidt you web user should be a member of the librenms group.

Can you copy paste the full web page you get?

Error: bootstrap/cache, storage, storage/framework/sessions, storage/framework/views, storage/framework/cache not writable! Run these commands as root on your LibreNMS server to fix:
chown -R librenms:librenms /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/storage/framework/sessions /opt/librenms/storage/framework/views /opt/librenms/storage/framework/cache

setfacl -R -m g::rwx /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/storage/framework/sessions /opt/librenms/storage/framework/views /opt/librenms/storage/framework/cache

setfacl -d -m g::rwx /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/storage/framework/sessions /opt/librenms/storage/framework/views /opt/librenms/storage/framework/cache

If using SELinux you may also need:
semanage fcontext -a -t httpd_sys_content_t ‘/opt/librenms/bootstrap/cache(/.*)?’

semanage fcontext -a -t httpd_sys_rw_content_t ‘/opt/librenms/bootstrap/cache(/.*)?’

restorecon -RFvv /opt/librenms/bootstrap/cache

semanage fcontext -a -t httpd_sys_content_t ‘/opt/librenms/storage(/.*)?’

semanage fcontext -a -t httpd_sys_rw_content_t ‘/opt/librenms/storage(/.*)?’

restorecon -RFvv /opt/librenms/storage

semanage fcontext -a -t httpd_sys_content_t ‘/opt/librenms/storage/framework/sessions(/.*)?’

semanage fcontext -a -t httpd_sys_rw_content_t ‘/opt/librenms/storage/framework/sessions(/.*)?’

restorecon -RFvv /opt/librenms/storage/framework/sessions

semanage fcontext -a -t httpd_sys_content_t ‘/opt/librenms/storage/framework/views(/.*)?’

semanage fcontext -a -t httpd_sys_rw_content_t ‘/opt/librenms/storage/framework/views(/.*)?’

restorecon -RFvv /opt/librenms/storage/framework/views

semanage fcontext -a -t httpd_sys_content_t ‘/opt/librenms/storage/framework/cache(/.*)?’

semanage fcontext -a -t httpd_sys_rw_content_t ‘/opt/librenms/storage/framework/cache(/.*)?’

restorecon -RFvv /opt/librenms/storage/framework/cache

I have the same issue as OP.

It is running on CentOS 7.

1 Like

Regarding group permissions, librenms has apache included. From /etc/groups;

librenms:x:994:apache

I had the same issue… validate.php :
Permission on librenms folder are ok.

[librenms@localhost ~]$./validate.php

Component Version
LibreNMS 1.39-59-g52eacf2e3
DB Schema 250
PHP 7.0.30
MySQL 5.1.73
RRDTool 1.3.8
SNMP NET-SNMP 5.5

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

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

Anyone have a suggestion? When I’m done with this instance I have another one to fix. Having these down is really sucking, especially when people ask how it’s going.

Got help from an alternative resource.
Re-ran this and the problem resolved; https://docs.librenms.org/#Installation/Installation-CentOS-7-Apache/#selinux

2 Likes

Thanks! This is also what solved the issue for me. Strange because I don’t remember ever setting up SElinux yet for this server…I could have swore I just skipped it because I’m just testing LibreNMS out right now.

For clarification for people that are still trying to fix their installations, I only did the steps included in the screenshot: image

After those commands, LibreNMS loaded right up in my browser (no need to restart anything).

thanks nikatnite
It is working fine :wink: