Queue module with sentinel

I cant get sentinel to work with queue module.

./console queuedtracking:monitor
Queue is enabled
Request sets in the queue will be processed automatically after a tracking request
Up to 1 workers will be used
Processor will start once there are at least 50 request sets in the queue
ERROR     [2024-08-13 14:55:42] 71607  Uncaught exception: /var/www/…/plugins/QueuedTracking/Queue/Backend/Sentinel.php(58): Could not receive an actual master from sentinel [Query: , CLI mode: 1]

This is my config:

       select * from matomo_plugin_setting;
+----------------+------------------------------+-------------------------------+--------------+------------+------------------+
| plugin_name    | setting_name                 | setting_value                 | json_encoded | user_login | idplugin_setting |
+----------------+------------------------------+-------------------------------+--------------+------------+------------------+
| Tour           | browse_marketplace_completed | 1                             |            0 | matomo     |                2 |
| QueuedTracking | backend                      | redis                         |            0 |            |               71 |
| QueuedTracking | useSentinelBackend           | 1                             |            0 |            |               74 |
| QueuedTracking | sentinelMasterName           | queue                         |            0 |            |               77 |
| QueuedTracking | redisHost                    | 10.4.0.20,10.4.0.19,10.4.0.18 |            0 |            |               80 |
| QueuedTracking | redisPort                    | 6380,6380,6380                |            0 |            |               83 |
| QueuedTracking | redisDatabase                | 0                             |            0 |            |               86 |
| QueuedTracking | redisPassword                | somepass                      |            0 |            |               89 |
| QueuedTracking | queueEnabled                 | 1                             |            0 |            |               92 |
| QueuedTracking | numQueueWorkers              | 1                             |            0 |            |               95 |
| QueuedTracking | numRequestsToProcess         | 50                            |            0 |            |               98 |
| QueuedTracking | processDuringTrackingRequest | 1                             |            0 |            |              101 |
+----------------+------------------------------+-------------------------------+--------------+------------+------------------+

I would assume that sentinel and redis is configured correctly because i was able connect to redis without the use of sentinel and the status seems to be fine:

10.4.0.19:26379> info sentinel
# Sentinel
sentinel_masters:2
sentinel_tilt:0
sentinel_running_scripts:0
sentinel_scripts_queue_length:0
sentinel_simulate_failure_flags:0
master0:name=queue,status=ok,address=10.4.0.20:6380,slaves=2,sentinels=3

What am I doing wrong?

I solved the Problem. If anyone has the same problem:

I changed the file Modules\QueuedTracking\Queue\Backend\Sentinel.php:

if (!class_exists('\Redis') && $this->timeout == 0) {
    $this->timeout === 0.05;
}

to

if (!class_exists('\Redis') && $this->timeout == 0) {
    $this->timeout = 0.05;
}

I think there are some more bugs with sentinel, because the CLI was not working without installing the php-redis extension and this souldnt be nessasary when reading the documentation when using sentinel.

1 Like

But in redisPort, need to put sentinel ports? In your example there are redis port

In matomo 5.1.0, I can’t use the module with sentinel

Yes you are right. Its the sentinel Port.

QueuedTracking backend redis 0
QueuedTracking useSentinelBackend 1 0
QueuedTracking sentinelMasterName queue 0
QueuedTracking redisHost 10.4.0.19,10.4.0.18,10.4.0.20 0
QueuedTracking redisPort 26379,26379,26379 0
QueuedTracking redisDatabase 0 0
QueuedTracking redisPassword somepass 0
QueuedTracking queueEnabled 1 0
QueuedTracking numQueueWorkers 8 0
QueuedTracking numRequestsToProcess 200 0

Even using the updated plugin (Queued Tracking 5.0.7) the configuration via sentinel does not work for me

plugin_name setting_name setting_value
QueuedTracking backend redis
QueuedTracking useSentinelBackend 1
QueuedTracking sentinelMasterName mymaster
QueuedTracking redisHost 10.205.21.9,10.205.21.10,10.205.21.11
QueuedTracking redisPort 26379,26379,26379
QueuedTracking redisDatabase 0
QueuedTracking redisPassword xxxxxxxxxx
QueuedTracking queueEnabled 1
QueuedTracking numQueueWorkers 4
QueuedTracking numRequestsToProcess 25
QueuedTracking processDuringTrackingRequest 1

whats the error message?
what is the output of “info sentinel”?
what is the output of “./console queuedtracking:monitor”?

10.205.21.9:26379> info sentinel

Sentinel

sentinel_masters:1
sentinel_tilt:0
sentinel_tilt_since_seconds:-1
sentinel_running_scripts:0
sentinel_scripts_queue_length:0
sentinel_simulate_failure_flags:0
master0:name=mymaster,status=ok,address=10.205.21.9:6379,slaves=2,sentinels=3
10.205.21.9:26379> quit

ERROR [2024-09-27 09:38:20] 3600519 Uncaught exception: /var/www/html/plugins/QueuedTracking/Queue/Backend/Sentinel.php(58): Could not receive an actual master from sentinel [Query: , CLI mode: 1]

Could not receive an actual master from sentinel

However via tcpdump I saw that it does not try authenticate to the sentinel.

yes, you should deploy an standard user with password in acl file. i think it was named default. And then enter the pass in matomo sentinel config.

1 Like