Symfony/Composer/PHP Problems

Hello,

I’m trying to install LibreNMS on Arch Linux using software compiled from source (Apache, MariaDB, PHP). Other than that, I’m using all libraries installed via the package manager, and am getting a strange Symfony/Yaml error when trying to access install.php. I would like to add that I managed to adapt the Ubuntu install instructions to work on Debian with the same compiled packages, but did not get this error previously.

[25-Apr-2018 14:12:49 Asia/Singapore] PHP Fatal error:  Uncaught Symfony\Component\Yaml\Exception\ParseException: Error. in /opt/librenms/vendor/symfony/yaml/Parser.php:847
Stack trace:
#0 /opt/librenms/vendor/symfony/yaml/Parser.php(160): Symfony\Component\Yaml\Parser::preg_match('#^(?P<key>(?:"(...', 'os: 3com', Array)
#1 /opt/librenms/vendor/symfony/yaml/Parser.php(78): Symfony\Component\Yaml\Parser->doParse('os: 3com\ntext: ...', false, false, false)
#2 /opt/librenms/vendor/symfony/yaml/Yaml.php(65): Symfony\Component\Yaml\Parser->parse('os: 3com\ntext: ...', false, false, false)
#3 /opt/librenms/includes/common.php(1611): Symfony\Component\Yaml\Yaml::parse('os: 3com\ntext: ...')
#4 /opt/librenms/includes/init.php(134): load_all_os(false)
#5 /opt/librenms/html/install.php(30): require('/opt/librenms/i...')
#6 {main}
  thrown in /opt/librenms/vendor/symfony/yaml/Parser.php on line 847

This is the only error that appears in the PHP log. I’ve tried various ways of installing Composer, and have reverted to the version of PHP that I have been using preiously on Debian, but with no effect.

If you look in /opt/librenms/vendor/symfony/yaml/Parser.php on line 847, it says:

    /**
     * A local wrapper for `preg_match` which will throw a ParseException if there
     * is an internal error in the PCRE engine.
     *
     * This avoids us needing to check for "false" every time PCRE is used
     * in the YAML engine
     *
     * @throws ParseException on a PCRE internal error
     *
     * @see preg_last_error()
     *
     * @internal
     */

That leads me to think that it is an internal PCRE error, but this is internal to PHP, and changing to another (known working) version of PHP doesn’t help. These are the software versions I’m running at the moment:

Apache 2.4.33
MariaDB 10.2.14
PHP 7.1.13/7.1.16
Composer 1.6.4

Does anyone have any idea what the problem could be?

Thanks!

Please post the output of ./validate.php

Hello,

If I run sudo -u librenms ./validate.php, I get the following message:

[FAIL] config.php does not exist, please copy config.php.default to config.php

If I copy config.php.default to config.php, then I cannot access install.php, as it redirects you to ‘/’ (index.php).

If I copy it anyway, I get:

user@host:/opt/librenms$ sudo -u librenms ./validate.php
[sudo] password for user:
====================================
Component | Version
--------- | -------
LibreNMS  | 1.38-68-g21e26a437
DB Schema | ?
PHP       | 7.1.13
MySQL     | ?
RRDTool   | 1.7.0
SNMP      | NET-SNMP 5.7.3
====================================

[OK]    Composer Version: 1.6.4
[OK]    Dependencies up-to-date.
[FAIL]  Error connecting to your database. Access denied for user 'USERNAME'@'localhost' (using password: YES)
[WARN]  Could not check poller/discovery, db is not connected.
[FAIL]  fping6 location is incorrect or bin not installed.
	[FIX] Install fping6 or manually set the path to fping6 by placing the following in config.php: $config['fping6'] = '/path/to/fping6';
[WARN]  Your RRD directory is not set to 0775
	[FIX] chmod 775 /opt/librenms/rrd}
[WARN]  Your install is over 24 hours out of date, last update: Sun, 22 Apr 2018 22:00:46 +0000
	[FIX] Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
[FAIL]  The rrd folder has improper permissions.
	[FIX] chmod ug+rw /opt/librenms/rrd
[FAIL]  The log folder has improper permissions.
	[FIX] chmod ug+rw /opt/librenms/logs
user@host:/opt/librenms$

OK, it’s a problem with the Arch packaged version of PCRE. If I install it from source, it works!

I use LibreNMS on an Arch box and don’t have any issues, but I’m using all standard packages (not AUR or compiled)

Thinking about it, it’s more likely to be the version of PCRE bundled with PHP. I would imagine that Symfony/Yaml require a particular version of the PCRE library, which PHP 7.1 is unable to provide.