Why does this keep happening? Issue with file permissions

Every so often I do a validate.php and see the [FIX] error about file permissions. I then fix it and it comes back. I haven’t check in weeks and just saw this today. Any idea of what is going on? (I did do the file permission changes again and now everything is fine but still wondering why it would revert back.)

[OK] Composer Version: 1.7.2

[OK] Dependencies up-to-date.

[OK] Database connection successful

[OK] Database schema correct

[ FAIL ] Some folders have incorrect file permissions, this may cause issues.

[ FIX ]:

sudo chown -R librenms:librenms /opt/librenms

sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/

sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/

I have the same happening with me…

Same here too

I got tired and setup a cronjobb that runs a script with these commands

This happens, because /opt/librenms/storage/framework/sessions/ contains token data registered by your web server user. This is expected as said by @murrant right here and obviously not a critical issue.

1 Like

Can you share your cron entry for us beginners :yum:

0 2 * * * /opt/librenms/fixrights.sh

cat /opt/librenms/fixrights.sh
sudo setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
chown librenms:librenms /var/lib/rrdcached/journal/
chown -R librenms:librenms /opt/librenms
1 Like

no need for sudo there, but it was a quick copy paste.

Thanks for the assist.

I have also had this problem. I solved this by running the commands as Root and not as a standard user.
do su root (su = switch user)
and try the commands again I hope I solved your problem with this.

I saw mine was not working…i was wondering why…will try the above.

same issue here as well (both on v 1.4.8 and on current 1.5.2), i have tried running commands as root and as librenms user, it keeps coming back a day or two later (when i check validate.php again). everything seems to be working fine, but id like to fix it as when you ask for help in forums first thing required is that you pass all validate.php checks (thus with this issue/bug, you cant).

any ideas on how to fix wo a cron “workaround”? thanks