添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I have a LibreNMS instance where the web page returns a blank page.

The log in /opt/librenms/logs/error_log tells me

[Tue Apr 02 10:30:45.844481 2019] [:error] [pid 10320] [client 10.18.0.223:41092] PHP Fatal error: Uncaught Error: Class ‘App\Facades\LogManager’ not found in /opt/librenms/app/Providers/AppServiceProvider.php:74\nStack trace:\n#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(726): App\Providers\AppServiceProvider->App\Providers\{closure}(Object(App\Application), Array)\n#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\Container\Container->build(Object(Closure))\n#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(575): Illuminate\Container\Container->resolve(‘log’)\n#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): Illuminate\Container\Container->make(‘log’)\n#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(66): Illuminate\Foundation\Application->make(‘log’)\n#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(81): Illuminate\Foundation\Exceptions\Handler->report(Object(Symfony in /opt/librenms/app/Providers/AppServiceProvider.php on line 74

Running ./validate.php tells me

PHP Fatal error:  Uncaught Error: Class 'App\Facades\LogManager' not found in /opt/librenms/app/Providers/AppServiceProvider.php:74
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(726): App\Providers\AppServiceProvider->App\Providers\{closure}(Object(App\Application), Array)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\Container\Container->build(Object(Closure))
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(575): Illuminate\Container\Container->resolve('log')
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): Illuminate\Container\Container->make('log')
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(66): Illuminate\Foundation\Application->make('log')
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(81): Illuminate\Foundation\Exceptions\Handler->report(Object(Symfony in /opt/librenms/app/Providers/AppServiceProvider.php on line 74
              

If you run these commands, does it help?

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/

Can you post full daily.sh and validate.php outputs

and also du -sh /opt/librenms/storage/logs

Thanks for the quick response. I ran your commands.

Running daily.sh with the librenms user gives the (massive) output

librenms@librenms:~$ ./daily.sh 
PHP Fatal error:  Class 'Illuminate\Log\LogManager' not found in /opt/librenms/app/Facades/LogManager.php on line 30
PHP Fatal error:  Uncaught Error: Class 'App\Facades\LogManager' not found in /opt/librenms/app/Providers/AppServiceProvider.php:74
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(726): App\Providers\AppServiceProvider->App\Providers\{closure}(Object(App\Application), Array)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\Container\Container->build(Object(Closure))
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(575): Illuminate\Container\Container->resolve('log')
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): Illuminate\Container\Container->make('log')
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(66): Illuminate\Foundation\Application->make('log')
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(81): Illuminate\Foundation\Exceptions\Handler->report(Object(Symfony in /opt/librenms/app/Providers/AppServiceProvider.php on line 74
Unsupported PHP version, switched to php56 branch. FAIL
error: Your local changes to the following files would be overwritten by checkout:
	.travis.yml
	LibreNMS/Alert/AlertUtil.php
	LibreNMS/Alert/Template.php
	LibreNMS/Alert/Transport/Gitlab.php
	LibreNMS/Alert/Transport/Msteams.php
	LibreNMS/Alert/Transport/Pushover.php
	LibreNMS/Alert/Transport/Telegram.php
	LibreNMS/Alert/Transport/Victorops.php
	LibreNMS/Alerting/QueryBuilderFilter.php
	LibreNMS/Config.php

More at https://pastebin.com/g2CMxUf8 (unable to post it all here)

Running ./validate.php with root gives the output
root@librenms:/opt/librenms# ./validate.php
PHP Fatal error: Class ‘Illuminate\Log\LogManager’ not found in /opt/librenms/app/Facades/LogManager.php on line 30
====================================
Component | Version
--------- | -------
LibreNMS | 1.44-54-gc37786d
DB Schema | Not Connected (0)
PHP | 7.0.33-0ubuntu0.16.04.3
MySQL | ?
RRDTool | 1.5.5
SNMP | NET-SNMP 5.7.3
====================================

[OK]    Composer Version: 1.8.4
[OK]    Dependencies up-to-date.
PHP Fatal error:  Uncaught Error: Class 'App\Facades\LogManager' not found in /opt/librenms/app/Providers/AppServiceProvider.php:74
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(726): App\Providers\AppServiceProvider->App\Providers\{closure}(Object(App\Application), Array)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\Container\Container->build(Object(Closure))
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(575): Illuminate\Container\Container->resolve('log')
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): Illuminate\Container\Container->make('log')
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(66): Illuminate\Foundation\Application->make('log')
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(81): Illuminate\Foundation\Exceptions\Handler->report(Object(Symfony in /opt/librenms/app/Providers/AppServiceProvider.php on line 74

The size of the logs are 12MB
12M /opt/librenms/storage/logs

Perhaps it could be as mentioned in the ./daily.sh output that my php version has changed (been updated) and is no longer supported? DB Schema is said to not be connected as well … Not sure what the expected behaviour / result should be

Is your environment set to manual updates?

did you try to update and then got the blank GUI, or do you roughly know how long its been blank for ?

Hopefully after you upgrade to php 7.2 you will see less issues.

It’s been blank for roughly the past week. I believe it was because of an update. It was set to automatic update but I turned it off today.

I may add that I run Ubuntu 16.04

I updated to php7.2 and ran ./validate.php and ./daily.sh again with similar result.

./validate.php
root@librenms:/opt/librenms# ./validate.php
PHP Fatal error: Class ‘Illuminate\Log\LogManager’ not found in /opt/librenms/app/Facades/LogManager.php on line 30
====================================
Component | Version
--------- | -------
LibreNMS | 1.44-54-gc37786d
DB Schema | Not Connected (0)
PHP | 7.2.16-1+ubuntu16.04.1+deb.sury.org+1
MySQL | ?
RRDTool | 1.5.5
SNMP | NET-SNMP 5.7.3
====================================

[OK]    Composer Version: 1.8.4
[OK]    Dependencies up-to-date.
PHP Fatal error:  Uncaught Error: Class 'App\Facades\LogManager' not found in /opt/librenms/app/Providers/AppServiceProvider.php:74
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(726): App\Providers\AppServiceProvider->App\Providers\{closure}(Object(App\Application), Array)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\Container\Container->build(Object(Closure))
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(575): Illuminate\Container\Container->resolve('log')
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): Illuminate\Container\Container->make('log')
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(66): Illuminate\Foundation\Application->make('log')
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(81): Illuminate\Foundation\Exceptions\Handler->report(Object(Symfony in /opt/librenms/app/Providers/AppServiceProvider.php on line 74

./daily.sh
librenms@librenms:~$ ./daily.sh
PHP Fatal error: Class ‘Illuminate\Log\LogManager’ not found in /opt/librenms/app/Facades/LogManager.php on line 30
PHP Fatal error: Uncaught Error: Class ‘App\Facades\LogManager’ not found in /opt/librenms/app/Providers/AppServiceProvider.php:74
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(726): App\Providers\AppServiceProvider->App\Providers{closure}(Object(App\Application), Array)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\Container\Container->build(Object(Closure))
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(575): Illuminate\Container\Container->resolve(‘log’)
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(728): Illuminate\Container\Container->make(‘log’)
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(66): Illuminate\Foundation\Application->make(‘log’)
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(81): Illuminate\Foundation\Exceptions\Handler->report(Object(Symfony in /opt/librenms/app/Providers/AppServiceProvider.php on line 74
PHP Fatal error: Class ‘Illuminate\Log\LogManager’ not found in /opt/librenms/app/Facades/LogManager.php on line 30
PHP Fatal error: Uncaught Error: Class ‘App\Facades\LogManager’ not found in /opt/librenms/app/Providers/AppServiceProvider.php:74
[…] More at https://pastebin.com/GjNUYuhS

I tried to reach the webinterface and saw a couple of missing dependencies for php7.2 which I installed. Then daily.sh / validate gave me some more information and [FIX] recommendations that I kept going at. After a little tweaking I managed to reach the site again and everything works as expected.

Thanks a lot for the help!