Alerts.php does nothing when using Redis as cache backend


I’m setting up a distributed poller setup with the Redis cache backend. When I started alerting I noticed alerts were registered in the GUI, but the transport was never called. Upon investigation I noticed that the alerts.php script does nothing when the CACHE_BACKEND=redis env variable is set, while polling and discovery is working fine.

With redis cache backend;

$ ./alerts.php -d

Without the redis cache backend;

$ ./alerts.php
Start: Tue, 22 Dec 2020 14:25:57 +0100
Muted Alert-UID #77977
Issuing Alert-UID #75728/1:
 :: Transport mattermost => OK

$ ./validate.php
Component | Version
--------- | -------
LibreNMS  | 1.70.1
DB Schema | 2020_10_12_095504_mempools_add_oids (191)
PHP       | 7.3.20
Python    | 3.6.8
MySQL     | 10.3.17-MariaDB
RRDTool   | 1.7.0
SNMP      | NET-SNMP 5.8
OpenSSL   |

Any ideas?

Just #CACHE_DRIVER=redis in .env and this will switch to sql lock. I had the same problem.

Yes that does work. But then I’m interested in the reason why this is happening? The Redis cache backend is recommended by the docs when configuring the distributed poller and as far as I know even required when using it in combination with the Dispatcher Service.

Some changes has been done recently to the database locker. Looks like for some reasons, this doesn’t work for everybody. I tried to redo this in a lab env but i cannot reproduce this issue.