LibreNMS and PHP 7.2

Hi,

New user here, wanting to report some issues with LibreNMS and PHP 7.2.0RC2.

I cloned the current LibreNMS master branch from Github. When I brought the site up in my browser, I got the following error:

Fatal error: Uncaught Symfony\Component\Yaml\Exception\ParseException: Unable to parse at line 1 (near “os: 3com”). in /usr/home/sites/librenms/lib/influxdb-php/vendor/symfony/yaml/Parser.php:285 Stack trace: #0 /usr/home/sites/librenms/lib/influxdb-php/vendor/symfony/yaml/Yaml.php(72): Symfony\Component\Yaml\Parser->parse(‘os: 3com\ntext: …’, false, false, false) #1 /usr/home/sites/librenms/includes/common.php(1637): Symfony\Component\Yaml\Yaml::parse(‘os: 3com\ntext: …’) #2 /usr/home/sites/librenms/includes/init.php(165): load_all_os(false) #3 /usr/home/sites/librenms/html/install.php(22): require(’/usr/home/sites…’) #4 {main} thrown in /usr/home/sites/librenms/lib/influxdb-php/vendor/symfony/yaml/Parser.php on line 285

I removed that copy of LibreNMS and then cloned the 1.30 branch instead. Same error message. I removed that and cloned version 1.29, and that worked. The installer came up with no error message (but complained about missing mcrypt).

Next, I downgraded my PHP installation to 7.1.9 and tried again with the current master branch of LibreNMS. The installer comes up with no errors.

So, something changed between version 1.29 and 1.30 that breaks the installer under PHP 7.2 and causes the YAML parsing error above. Being brand new to LibreNMS I’m not familiar with the codebase to debug it. Comparing those two branches, a lot changed. At first glance, maybe this commit introduced the trouble, but I haven’t stepped through to see what load_all_os() does.

Also, the mcrypt extension is completely removed in PHP 7.2. Are there plans to replace mcrypt with something else in LibreNMS? I searched the forum and the Github issues for both mcrypt and 7.2 but nothing stuck out. For now it’s impossible to run LibreNMS under PHP 7.2.

This is a library we use and it is unfortunately outside of our normal dependency tracking, so it is probably out of date. Likely, the library version does not support php 7.2

1 Like

I think the mcrypt removal is going to give us a bit of trouble. Several of our libraries use it, but they don’t support working without until recent releases. Most of those recent releases require PHP >5.3.

Until, we raise our minimum PHP version it might be difficult for us to support PHP 7.2.

1 Like

Thanks, it sounds like mcrypt is more of an issue for the dependencies to tackle. grepping the source tree, all of the calls to mcrypt functions are inside the vendor directory. Hopefully they migrate to libsodium at some point.