Open rekup opened 1 month ago
Rspamadm does not execute on_load or periodic scripts, hence it cannot deal with Sentinels resolution. It can probably be fixed but it'll require quite a lot of manual efforts for little benefit so I'd set it as a very low priority task (probably never to be done).
Prerequisites
Describe the bug When using redis-sentinel the
rspamadm dmarc_report
command will not send any dmarc reports unless the first server defined in the redis configsservers
option is the current primary (and thus writable) node.Steps to Reproduce
servers
option of the rspamd redis config while making sure the first defined server is not the current primary serverrspamadm dmarc_report -v
commandExpected behavior I would expect that the reports will be sent successfully.
Versions
Additional Information
If we run the command, we get the following output:
It seems like there is no error, but there are also no reports sent. We then used
strace
to troubleshoot further:As soon as rspamd tries to rename a key in redis probably here: https://github.com/rspamd/rspamd/blob/27b858776562a743a6036d5f6e1ee022d2006f79/lualib/rspamadm/dmarc_report.lua#L485 we get an error which indicates that rspamd tried to write to a read only replica of redis. If we run the command with the
--no-opt
flag (which does not perform any write operatios to redis) we can see that there are multiple reports available.I suspect that https://github.com/rspamd/rspamd/blob/27b858776562a743a6036d5f6e1ee022d2006f79/lualib/lua_redis.lua#L78 is not being called during
rspamadm dmarc_report
. As a result, rspamd will use the first redis server defined in the redis config:If the first server in the list is a replica, it will be read-only and the
rspamadm dmarc_report
command will not send any reports and fail silently.