Unable to poll devices

Hi Guys:

I am unable to poll devices. I gone through numerous troubleshooting steps from my searches but I have not found a solution. I can run validate.php fine. I cannot run:
/opt/librenms/poller-wrapper.py.

It fails with this error:
bash-4.2$ /opt/librenms/poller-wrapper.py
Cannot create logfile. Trying to obtain temporary log file.
Message: [Errno 13] Permission denied: ‘/root/logs/poller_wrapper.log’
Trying temporary log file in /tmp/LibreNMS.library.log
[Errno 13] Permission denied: ‘/root/logs/poller_wrapper.log’
Using [/tmp/LibreNMS.library.log]
2020-12-16 10:03:20,665 :: WARNING :: Failed to use log file [logs/poller_wrapper.log], [Errno 13] Permission denied: ‘/root/logs/poller_wrapper.log’
Using [/tmp/LibreNMS.library.log].
ERROR: Could not connect to MySQL database!
ERROR: (2003, “Can’t connect to MySQL server on ‘localhost’ ([Errno 111] Connection refused)”)

I can log into the db using the librenms user.

Here is the grep for mysql:
[root@librenms ~]# ps -aux | grep mysql
mysql 1018 0.0 0.0 113416 1592 ? Ss 08:55 0:00 /bin/sh /usr/bin/mysqld_safe --basedir=/u
mysql 1382 0.3 2.9 1760624 175392 ? Sl 08:55 0:09 /usr/libexec/mysqld --basedir=/usr --datab64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket
root 4262 0.0 0.0 112812 968 pts/0 S+ 09:47 0:00 grep --color=auto mysql

Here is the validate.php:

bash-4.2$ ./validate.php

Component Version
LibreNMS 1.70.1-5-g8e718d6
DB Schema 2020_11_02_164331_add_powerstate_enum_to_vminfo (191)
PHP 7.4.13
Python 3.6.8
MySQL 5.5.68-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2

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

[OK] Composer Version: 2.0.8
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
bash-4.2$

I am running CentOS 7.9. This system has been working for a long time. Now I receive no devices polled when logged into the web. Graphs will not show up i the webui. I upgraded to php7.4 from 7.2 but that has not fixed the issue. I also ran the daily.sh with no issues.

Any help would be appreciated.

Thanks,
Ed

If I run poller-wrapper.py as root this is the error I receive:
[root@librenms librenms]# ./poller-wrapper.py
Traceback (most recent call last):
File “./poller-wrapper.py”, line 28, in
import LibreNMS.library as LNMS
File “/opt/librenms/LibreNMS/init.py”, line 12, in
from .service import Service, ServiceConfig
File “/opt/librenms/LibreNMS/service.py”, line 6, in
import pymysql
ModuleNotFoundError: No module named ‘pymysql’

Yet when I try to install it it say MySql-pyton is already installed:
[root@librenms librenms]# dnf -y install MySQL-python
Last metadata expiration check: 0:00:30 ago on Wed 16 Dec 2020 01:52:50 PM PST.
Package MySQL-python-1.2.5-1.el7.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

make sure /opt/librenms is own by librenms user/group
chown -R -v librenms:librenms /opt/librenms

Also I see it’s complaining about pymysql did you run pip install pymysql

Wierd. This was a running platform then it just stopped. I reran the chown and installed pymysql. Now I am getting:
bash-4.2$ ./poller-wrapper.py
ERROR: Could not connect to MySQL database!
ERROR: (2003, “Can’t connect to MySQL server on ‘localhost’ ([Errno 111] Connection refused)”)

But I can log into the database using the librenms user and password. and mysql is running:
bash-4.2$ ps -aux | grep mysql
mysql 1015 0.0 0.0 113416 1592 ? Ss 11:29 0:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
mysql 1325 0.3 3.8 1300096 231520 ? Sl 11:29 0:36 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock

and .validate.php is fine:

bash-4.2$ ./validate.php

Component Version
LibreNMS 1.70.1-6-g9ccb707
DB Schema 2020_11_02_164331_add_powerstate_enum_to_vminfo (191)
PHP 7.4.13
Python 3.6.8
MySQL 5.5.68-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2

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

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