LibreNMS in Ubuntu 21.04 Could not connect to Databases

====================================

Component Version
LibreNMS 21.7.0-28-g7c41698e4
DB Schema Not Connected (0)
PHP 7.4.16
Python 3.9.5
MySQL ?
RRDTool 1.7.2
SNMP NET-SNMP 5.9

====================================

[OK] Composer Version: 2.1.5
[OK] Dependencies up-to-date.
Could not connect to database, check logs/librenms.log.

● mariadb.service - MariaDB 10.5.10 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-07-28 12:40:19 AEST; 36min ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 873 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Process: 923 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 925 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=cd /usr/bin/..; /usr/bin/galera_recovery; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, statu>
Process: 1228 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 1230 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
Main PID: 1014 (mariadbd)
Status: “Taking your SQL requests now…”
Tasks: 13 (limit: 19079)
Memory: 88.8M
CGroup: /system.slice/mariadb.service
└─1014 /usr/sbin/mariadbd

[28-Jul-2021 12:40:00] NOTICE: ready to handle connections
[28-Jul-2021 12:40:00] NOTICE: systemd monitor interval set to 10000ms

If you are having troubles with discovery/polling include the pastebin output of:

./discovery.php -h HOSTNAME -d | ./pbin.sh
./poller.php -h HOSTNAME -r -f -d | ./pbin.sh

Still can’t find problem.

Hi,

Did you check the logs?
Apart from that, make youre you have a valid database config in the .env file like so:

DB_HOST=localhost
DB_DATABASE=librenms
DB_USERNAME=librenms
DB_PASSWORD=foobar

then run php artisan config:clear and check again

Hi,
Thank you for answering. I removed the database recreate it and run the daily.sh to get the latest schema and is working.

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