Poller-wrapper can not access mysql; php does

Somehow my poller stopped working:

[email protected]:~$ ./poller-wrapper.py
ERROR: Could not connect to MySQL database!
ERROR: (1045, "Access denied for user 'librenms'@'' (using password: YES)")

installation is valid:

[email protected]:/opt/librenms$ sudo ./validate.php
Component | Version
--------- | -------
LibreNMS  | 1.63-106-g370c7f566
DB Schema | 2020_04_13_150500_add_last_error_fields_to_bgp_peers (164)
PHP       | 7.3.14-1~deb10u1
Python    | 3.7.3
MySQL     | 10.3.22-MariaDB-0+deb10u1
RRDTool   | 1.7.1
SNMP      | NET-SNMP 5.7.3

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

Both the poller.php and the discovery.php script run fine. Debian 10; packages installed as documented in the installer.

Any thoughts?


Does mysql cli client work normally? Are your credentials in .env good and do not contain spaces?

Goedemiddag :slight_smile:

[email protected]:/opt/librenms$ grep " $" .env
[email protected]:/opt/librenms$ grep DB .env
[email protected]:/opt/librenms$ mysql -u librenms -pPass12$ librenms
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4066896
Server version: 10.3.22-MariaDB-0+deb10u1 Debian 10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

As far as I can see it seems python related; not MySQL/MariaDB

I’ve changed the password to just [A-Z][a-z] characters but no success. ./validate connects without problems; poller-wrapper.py does not. /var/log/mysql/error.log:

2020-05-20 17:25:34 5282 [Warning] Access denied for user 'librenms'@'localhost' (using password: YES)

Try to use the ipv4 or ipv6 loopback address instead of localhost to see if that makes a difference.

You have 2 options:

  1. Add librenms@::1 user like the ipv4 one
  2. Change localhost with as db_host in both .env and config.php

Using in .env and config.php kills validate.php. Adding ‘librenms’@‘::1’ to the mysql user tabel makes no difference :slightly_frowning_face:

For quick fix, configure to use socket, but something happens there as adding ::1 (with the same password, of course) should have fixed it, or at least moving to

Thanx for all the suggestions. I ended up reinstalling Mariadb and restoring from backup.

I have this issue too

I had an issue with python3-mysqldb which I didn’t have installed.

i have same issue and this my solution,
first, change the host of the DB_USERNAME to on mysql.user then also update librenms database user privileges from @‘localhost’ to @‘’
after all changes DB_HOST on .env and config.php

i don’t know why poller-wrapper of the new version librenms can’t read the @‘localhost’ but validate.php can.

Its a Python 3 thing