WebUI: Error: "Whoops, the web server could not write required files to the filesystem."

Hi all,

I can’t login to LibreNMS any longer. This happens since this weekend or on Friday. I did:

sudo chown -R librenms:librenms /opt/librenms
sudo setfacl -d -m g::rwx /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/logs /opt/librenms/rrd
sudo chmod -R ug=rwX /opt/librenms/bootstrap/cache /opt/librenms/storage /opt/librenms/logs /opt/librenms/rrd

librenms.log:

[2019-01-21 15:17:52] production.ERROR: ErrorException: file_put_contents(/opt/librenms/storage/framework/sessions/VlfZioAyVNQearMBIxKhQne05jUufcmyYDQiIB7d): failed to open stream: Permission denied in /opt/librenms/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:122
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_put_conten...', '/opt/librenms/v...', 122, Array)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(122): file_put_contents('/opt/librenms/s...', 'a:3:{s:6:"_toke...', 2)
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Session/FileSessionHandler.php(83): Illuminate\Filesystem\Filesystem->put('/opt/librenms/s...', 'a:3:{s:6:"_toke...', true)
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Session/Store.php(128): Illuminate\Session\FileSessionHandler->write('VlfZioAyVNQearM...', 'a:3:{s:6:"_toke...')
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(88): Illuminate\Session\Store->save()
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(218): Illuminate\Session\Middleware\StartSession->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(189): Illuminate\Foundation\Http\Kernel->terminateMiddleware(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#7 /opt/librenms/html/index.php(58): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#8 {main}

OS: Ubuntu 16.04 + PHP 7.0, updated to today to Ubuntu 18.04. + PHP 7.2 - same error
Branch: master

====================================
Component | Version
--------- | -------
LibreNMS  | 1.47-87-g45e0e5e19
DB Schema | 1000
PHP       | 7.2.10-0ubuntu0.18.04.1
MySQL     | 10.1.34-MariaDB-0ubuntu0.18.04.1
RRDTool   | 1.7.0
SNMP      | NET-SNMP 5.7.3
====================================

Server version: Apache/2.4.29 (Ubuntu)
Server built:   2018-10-10T18:59:25
Server's Module Magic Number: 20120211:68
Server loaded:  APR 1.6.3, APR-UTIL 1.6.1
Compiled using: APR 1.6.3, APR-UTIL 1.6.1
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/etc/apache2"
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="mime.types"
 -D SERVER_CONFIG_FILE="apache2.conf"

Please help!

I fixed it myself by re-running some steps from install guide but I don’t know which one fixed it finally:

apt install curl apache2 composer fping git graphviz imagemagick libapache2-mod-php7.2 mariadb-client mariadb-server mtr-tiny nmap php7.2-cli php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-mysql php7.2-snmp php7.2-xml php7.2-zip python-memcache python-mysqldb rrdtool snmp snmpd whois
usermod -a -G librenms www-data
systemctl stop apache2
systemctl start apache2
a2enmod php7.2
a2dismod mpm_event
a2enmod mpm_prefork
chown -R librenms:librenms /opt/librenms
setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/

Browser: http://librenms.example.com/install.php

Now I can see my graphs again, issue started with daily.sh run on Saturday 0:00AM.
Really weird…