Web frontend error

As I have a librenms installation on centos !
vivafm|690x165
Problem is webui


checking the log this is what I get :slight_smile:
[2018-09-17 20:38:04] production.ERROR: ErrorException: session_write_close(): open(/var/lib/php/session/sess_3c3era69l84ffp9g36kfmr11j4, O_RDWR) failed: Permission denied (13) in /opt/librenms/LibreNMS/Authentication/LegacyAuth.php:121
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, ‘session_write_c…’, ‘/opt/librenms/L…’, 121, Array)
#1 /opt/librenms/LibreNMS/Authentication/LegacyAuth.php(121): session_write_close()
#2 /opt/librenms/app/Http/Middleware/LegacySession.php(42): LibreNMS\Authentication\LegacyAuth::setUpLegacySession()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): App\Http\Middleware\LegacySession->handle(Object(Illuminate\Http\Request), Object(Closure))
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#5 /opt/librenms/app/Http/Middleware/LegacyExternalAuth.php(38): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): App\Http\Middleware\LegacyExternalAuth->handle(Object(Illuminate\Http\Request), Object(Closure))
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(65): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#11 /opt/librenms/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php(54): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))

[root@localhost librenms]# ./validate.php

Component Version
LibreNMS 1.43-82-gcf31776
DB Schema 267
PHP 7.0.31
MySQL 5.5.60-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2
====================================

[OK] Composer Version: 1.7.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[root@localhost librenms]#

I do understand that is some permission issue but no idea how to fix it !
I would appreciate any suggestion

Please, search a bit in the forum and you will find the solution.

I dont want to be rude, but I wrote the solution more than 10 times.

Search for “Error 500”, “Whoops, something…” etc

Please forgive me !
I did search and try to apply all the solutions before I applied to this forum.
It something I missed I will redo all my search
Thank you

For your error, seems the solution is step 3

I already tried all 3 steps and it did not work out
Please trust me I did search in the community in a last 2 days no joy yet
Here is what i did fallowing your advice:

[root@localhost ~]# cd /opt/librenms/
[root@localhost librenms]# ./scripts/composer_wrapper.php install --no-dev
Do not run Composer as root/super user! See How do I install untrusted packages safely? Is it safe to run Composer as superuser or root? - Composer for details

LibreNMS\ComposerHelper::preInstall
Loading composer repositories with package information
Installing dependencies from lock file
Nothing to install or update
Generating autoload files
LibreNMS\ComposerHelper::postInstall
Illuminate\Foundation\ComposerScripts::postInstall
php artisan optimize
Generating optimized class loader
The compiled services file has been removed.
[root@localhost librenms]# chown -R librenms:librenms /opt/librenms
[root@localhost librenms]# setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
[root@localhost librenms]# setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/

[root@localhost librenms]#
[root@localhost librenms]# setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
[root@localhost librenms]#

can you suggest what I could do to troubleshoot

This is what I found and it seems to be the problem or I think it is

production.ERROR: ErrorException: session_write_close(): open(/var/lib/php/session/sess_3c3era69l84ffp9g36kfmr11j4, O_RDWR) failed: Permission denied (13) in /opt/librenms/LibreNMS/Authentication/LegacyAuth.php:121

this is how it looks the line 13 ont the LegacyAuth file

<?php namespace LibreNMS\Authentication; use Auth; use LibreNMS\Config; use LibreNMS\Interfaces\Authentication\Authorizer; class LegacyAuth { protected static $_instance; private static $configToClassMap = array( 'mysql' => 'LibreNMS\Authentication\MysqlAuthorizer',

Oh, missread where the permission denied was from.

Does your http user has write access to that folder (/var/lib/php/session )

Also, if you are running php-fpm you must restart it.

I restarted php-fpm
This is what I have in session folder
and it seems that is not the same that he try to use
[root@localhost librenms]# cd /var/lib/php/session "open(/var/lib/php/session/sess_3c3era69l84ffp9g36kfmr11j4, O_RDWR) failed: "
[root@localhost session]# ls
sess_7ogd08brfjhmkuhi36pfpaf0t6 sess_bikomksa38m7tmjo5j1ge1f7g3 sess_s6vvf6566jnm51slk57o9rko81

I will give you the bast feedback ever if we manage to fix this !

What user is php-fpm running as? what are the permissions on /var/lib/php/session and included files ls -lR /var/lib/php?

Thank you to respond I saw that you are very present on this I’m happy
here is the output :smile:
[root@localhost librenms]# ls -lR /var/lib/php
/var/lib/php:
total 0
drwxrwx—. 2 root nginx 123 Sep 15 22:03 session
drwxrwx—. 2 root apache 6 Jul 20 21:04 wsdlcache

/var/lib/php/session:
total 12
-rw------- 1 apache apache 123 Sep 15 22:43 sess_7ogd08brfjhmkuhi36pfpaf0t6
-rw------- 1 apache apache 128 Sep 3 02:31 sess_bikomksa38m7tmjo5j1ge1f7g3
-rw------- 1 apache apache 128 Sep 2 18:04 sess_s6vvf6566jnm51slk57o9rko81

/var/lib/php/wsdlcache:
total 0

as somebody adviced I checked that I use nginx so I changed the permission to nginx
[root@localhost librenms]# ls -lR /var/lib/php
/var/lib/php:
total 0
drwxrwx—. 2 nginx nginx 123 Sep 15 22:03 session
drwxrwx—. 2 nginx nginx 6 Jul 20 21:04 wsdlcache

/var/lib/php/session:
total 12
-rw------- 1 nginx nginx 123 Sep 15 22:43 sess_7ogd08brfjhmkuhi36pfpaf0t6
-rw------- 1 nginx nginx 128 Sep 3 02:31 sess_bikomksa38m7tmjo5j1ge1f7g3
-rw------- 1 nginx nginx 128 Sep 2 18:04 sess_s6vvf6566jnm51slk57o9rko81
restarted the service nginx and php-fpm and still no joy
this is the log
2018-09-18 06:56:40] production.ERROR: ErrorException: session_write_close(): open(/var/lib/php/session/sess_3c3era69l84ffp9g36kfmr11j4, O_RDWR) failed: Permission denied (13) in /opt/librenms/LibreNMS/Authentication/LegacyAuth.php:121

ps aux|grep php-fpm

Last login: Tue Sep 18 05:51:32 2018 from 10.60.130.11
[root@localhost ~]# ps aux|grep php-fpm
root 64663 0.0 0.0 112660 976 pts/0 S+ 08:49 0:00 grep --color=auto php-fpm
root 95318 0.0 0.4 373628 16232 ? Ss 06:47 0:00 php-fpm: master process (/etc/php-fpm.conf)
apache 95319 0.0 0.4 378660 16372 ? S 06:47 0:00 php-fpm: pool www
apache 95320 0.0 0.2 373628 8500 ? S 06:47 0:00 php-fpm: pool www
apache 95321 0.0 0.4 378660 16372 ? S 06:47 0:00 php-fpm: pool www
apache 95322 0.0 0.2 373628 8500 ? S 06:47 0:00 php-fpm: pool www
apache 95323 0.0 0.2 373628 8504 ? S 06:47 0:00 php-fpm: pool www
[root@localhost ~]#
done
This mean it should run apache
[root@localhost ~]# systemctl status apache
Unit apache.service could not be found.
[root@localhost ~]# whereis apache
apache:[root@localhost ~]#

chown -R apache:apache /var/lib/php/session

Should have you fixed up. Pretty sure your OS just uses the apache user so there isn’t any issues no matter if you use nginx or apache.

Okey done do I have to restart php-fpm ?

Urra beatiful just beatiful … works perfect …how can I thank you …this is magic … love this

Please let me know what can I do to promote or express my gratitude to this help ???