DB Schema | Not Connected and Database | Not Connected after php81 upgrade

hello,

after upgrading on 2 other server with no issue, my third server throws problems.

  1. the ‘my.cnf’ files was empty, fixed that with the ‘my.cnf.rpmsave’ backup
  2. .env file is fine
  3. permissions are correct in all directory’s as i ran -

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

  1. Database appears to be intact, i ran a repair and all is “ok”

here is output of ‘validate.php’

In config.php line 44:
                                          
  Undefined constant "discovery_modules"  
                                          

====================================
Component | Version
--------- | -------
LibreNMS  | 22.9.0-3-g06c361c
DB Schema | Not Connected (0)
PHP       | 8.1.11
Python    | 3.6.8
Database  | Not Connected
RRDTool   | 1.4.8
SNMP      | 5.7.2
====================================

[OK]    Composer Version: 2.4.2
[OK]    Dependencies up-to-date.
bash-4.2$

output of ‘daily.sh’

bash-4.2$ ./daily.sh
PHP Fatal error: Uncaught Error: Undefined constant “discovery_modules” in /opt/librenms/config.php:44
Stack trace:
#0 Command line code(1): include()
#1 {main}
thrown in /opt/librenms/config.php on line 44

In config.php line 44:

Undefined constant “discovery_modules”

PHP Fatal error: Uncaught Error: Undefined constant “discovery_modules” in /opt/librenms/config.php:44
Stack trace:
#0 Command line code(1): include()
#1 {main}
thrown in /opt/librenms/config.php on line 44
Updating SQL-Schema /opt/librenms/daily.sh: line 62: /daily.log: Permission denied
/opt/librenms/daily.sh: line 65: /daily.log: Permission denied
/opt/librenms/daily.sh: line 66: /daily.log: Permission denied
OK
Cleaning up DB /opt/librenms/daily.sh: line 62: /daily.log: Permission denied
/opt/librenms/daily.sh: line 65: /daily.log: Permission denied
/opt/librenms/daily.sh: line 66: /daily.log: Permission denied
OK

In config.php line 44:

Undefined constant “discovery_modules”

bash-4.2$

line 44 of /opt/librenms/config.php -
$config[discovery_modules][discovery-arp] = 1;

what am i missing?
I stalked around for a similar issue and none of those fixes helped.

Thanks in advance

-Mike

That should be quoted I’d have thought - are the other things in config.php quoted?

$config['discovery_modules']['discovery-arp'] = 1;

Cut and paste it from here if unsure: Discovery Support - LibreNMS Docs

1 Like

Thank you, that fixed it. missing the single quote.

Thanks!

-Mike

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.