Isssue after runing ./daily.sh

After running ./daily.sh webpages are not loading.

Here is the output from cat /var/log/nginx/error.log
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(803): ReflectionClass->__construct(‘App\Http\Kernel’)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(681): Illuminate\Container\Container->build(‘App\Http\Kernel’)
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(785): Illuminate\Container\Container->resolve(‘App\Http\Kernel’, Array, false)
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(265): Illuminate\Foundation\Application->resolve(‘App\Http\Kernel’, Array, false)
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): Illuminate\Container\Container->Illuminate\Container{closure}(Object(App\Application), Array)
#5 /opt/librenms/vendor/larav" while reading response header from upstream, client: 10...195, server: librenms.prp.lcl, request: “GET /login HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php-fpm/php7.2-fpm.sock:”, host: “librenms.prp.lcl”
2020/07/08 14:11:28 [error] 101232#0: *5 FastCGI sent in stderr: "PHP message: PHP Warning: include(/opt/librenms/app/Http/Kernel.php): failed to open stream: Permission denied in /opt/librenms/vendor/composer/ClassLoader.php on line 444
PHP message: PHP Warning: include(): Failed opening ‘/opt/librenms/vendor/composer/…/…/app/Http/Kernel.php’ for inclusion (include_path=’.:/usr/share/pear:/usr/share/php’) in /opt/librenms/vendor/composer/ClassLoader.php on line 444
PHP message: PHP Fatal error: Uncaught ReflectionException: Class App\Http\Kernel does not exist in /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php:803

This is the output from ./validate.php

Component Version
LibreNMS 1.65-17-ga3cd90d
DB Schema 2020_06_23_00522_alter_availability_perc_column (170)
PHP 7.2.31
Python 3.6.8
MySQL 5.5.65-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2

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

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

after running sudo chown -R nginx:nginx /opt/librenms/ the webpage will load but then graphs will not work

I found the issue.
My /etc/nginx/conf.d/librenms.conf was configured incorrectly in the past.
And I had not configured PHP-FPM correctly.

After running
cp /etc/php-fpm.d/www.conf /etc/php-fpm.d/librenms.conf
vi /etc/php-fpm.d/librenms.conf

Change “www” to “librenms”

[librenms]

Change user and group to “librenms”

user = librenms
group = librenms

Change listen to a unique name

listen = /run/php-fpm-librenms.sock

And then I changed

vi /etc/nginx/conf.d/librenms.conf

to read

server {
listen 80;
server_name librenms.example.com;
root /opt/librenms/html;
index index.php;

charset utf-8;
gzip on;
gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ [^/].php(/|$) {
fastcgi_pass unix:/run/php-fpm-librenms.sock;
fastcgi_split_path_info ^(.+.php)(/.+)$;
include fastcgi.conf;
}
location ~ /.(?!well-known).* {
deny all;
}
}

Restarted Nginx and php-fpm everything stated working correctly

2 Likes