Librenms.log broken after php7.3 update

Hello everybody,

Since the php 7.3 update (I’ve used the same exact config used in php 7.2 before), I see this error every time I try to logon on the web interface:

# Whoops, the web server could not write required files to the filesystem.
### Running the following commands will fix the issue most of the time:

### Cannot write to log file: "logs/librenms.log"

Make sure it exists and is writable, or change your LOG_DIR setting.

#### If using SELinux you may also need:

semanage fcontext -a -t httpd_sys_rw_content_t 'logs/librenms.log(/.*)?'

restorecon -RFv logs/librenms.log

The strange thing is that I don’t have error in the librenms log, only the polling info (polling, services, and notification works well).

Validate output:

root@libre:/opt/librenms# ./validate.php
Component | Version
--------- | -------
LibreNMS  | 1.47-44-g29f8a8d4a
DB Schema | 281
PHP       | 7.3.0-2+0~20181217092659.24+stretch~1.gbp54e52f
MySQL     | 10.3.12-MariaDB-1:10.3.12+maria~stretch
RRDTool   | 1.6.0
SNMP      | NET-SNMP 5.7.3

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

Logs folder output:

root@libre:/opt/librenms/logs# ls -l
total 41192
-rwxrwxr-- 1 librenms librenms 38077540 mai   15  2016 access_log
-rwxrwxr-- 1 librenms librenms  2086408 janv. 14 00:15 daily.log
-rwxrwxr-- 1 librenms librenms   864828 mai   15  2016 error_log
-rw-rwxr-- 1 librenms librenms  1131895 janv. 14 07:30 librenms.log

It works if I use chmod 664 on the librenms.log file but the permissions change back to what I’ve outputed. Any idea why?

Thanks :slight_smile:

Unfortunately, I do not dare to say what it could be. what I do know is that if you update PHP you should delete the old version otherwise librenms will look at the old config.

Have you removed PHP 7.2? this is my experience by own upgrade php 7.0 to 7.2

I’ve just tried with the configuration files purge but the problem is the same.
Something is changing the permissions on the librenms.log file and I don’t know what is doing that :neutral_face:


I don’t have configured one myself. I there is one, it must be built with librenms.
The strange thing is that the problem came with php 7.3.
With the exact same php config it works well on 7.2 and I’ve never had this problem before :weary:

Edit from 15pm (UTC+1):
I’ve put back php7.2 using the same php.ini as 7.3 and it work back out of the box without changing anything in the permissions.


I’ve put back 7.3 in nginx back and now it works :no_mouth:

The only thing I did is emptied all the files in LibreNMS logs folder and it seems to work right now, I’ll keep you updated.

Edit from 1545pm (UTC+1):
It’s back … I don’t what is that thing that crash the librenms.log file.

I don’t know but it appears to only be happening on your system. I really doubt it is related to PHP 7.3 directly.

I think it is related to php 7.3 directly.
This install worked well on 5.6 -> 7.0 -> 7.2 and now this happens only with 7.3. Move back to 7.2 solved this.
I think I’m just gonna stay in 7.2 for now and see if nobody had an idea. :man_shrugging: