Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis replication logs errors since requirepass was added #6283

Open
5 tasks done
cr3 opened this issue Jan 30, 2025 · 4 comments
Open
5 tasks done

Redis replication logs errors since requirepass was added #6283

cr3 opened this issue Jan 30, 2025 · 4 comments
Labels

Comments

@cr3
Copy link

cr3 commented Jan 30, 2025

Contribution guidelines

I've found a bug and checked that ...

  • ... I understand that not following the below instructions will result in immediate closure and/or deletion of my issue.
  • ... I have understood that this bug report is dedicated for bugs, and not for support-related inquiries.
  • ... I have understood that answers are voluntary and community-driven, and not commercial support.
  • ... I have verified that my issue has not been already answered in the past. I also checked previous issues.

Description

Since requirepass was added to the /redis.conf by the data/conf/redis/redis-conf.sh entrypoint, the logs output in the redis-mailcow docker container console show replication errors (see logs below). This does not happen immediately, it only noticed that it is triggered when initiating POSTing to the rspamd-mailcow:11333/scan endpoint.

This is partially fixed by adding masterpass $REDISPASS, in addition to requirepass $REDISPASS in data/conf/redis/redis-conf.sh but there are still some errors (see logs below).

Logs:

Logs with only requirepass $REDISPASS, where the last few lines are repeated over and over again:

1:S 30 Jan 2025 16:50:15.029 * Before turning into a replica, using my own master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer.
1:S 30 Jan 2025 16:50:15.029 * Connecting to MASTER 172.22.1.249:6379
1:S 30 Jan 2025 16:50:15.029 * MASTER <-> REPLICA sync started
1:S 30 Jan 2025 16:50:15.029 * REPLICAOF 172.22.1.249:6379 enabled (user request from 'id=5 addr=172.22.1.3:36672 laddr=172.22.1.249:6379 fd=10 name= age=0 idle=0 flags
=N db=0 sub=0 psub=0 ssub=0 multi=-1 watch=0 qbuf=46 qbuf-free=20428 argv-mem=23 multi-mem=0 rbs=16384 rbp=16384 obl=0 oll=0 omem=0 tot-mem=37807 events=r cmd=slaveof u
ser=default redir=-1 resp=2 lib-name= lib-ver=')
1:S 30 Jan 2025 16:50:15.030 * Non blocking connect for SYNC fired the event.
1:S 30 Jan 2025 16:50:15.030 * Master replied to PING, replication can continue...
1:S 30 Jan 2025 16:50:15.030 * (Non critical) Master does not understand REPLCONF listening-port: -NOAUTH Authentication required.
1:S 30 Jan 2025 16:50:15.030 * (Non critical) Master does not understand REPLCONF capa: -NOAUTH Authentication required.
1:S 30 Jan 2025 16:50:15.030 * Trying a partial resynchronization (request 8db103ec7633487b23a914fcb0ad5ede81073f0b:1).
1:S 30 Jan 2025 16:50:15.030 # Unexpected reply to PSYNC from master: -NOAUTH Authentication required.
1:S 30 Jan 2025 16:50:15.030 * Retrying with SYNC...
1:S 30 Jan 2025 16:50:15.030 # MASTER aborted replication with an error: NOAUTH Authentication required.
1:S 30 Jan 2025 16:50:15.030 * Reconnecting to MASTER 172.22.1.249:6379 after failure
1:S 30 Jan 2025 16:50:15.030 * MASTER <-> REPLICA sync started
1:S 30 Jan 2025 16:50:15.030 * Non blocking connect for SYNC fired the event.
1:S 30 Jan 2025 16:50:15.030 * Master replied to PING, replication can continue...
1:S 30 Jan 2025 16:50:15.031 * (Non critical) Master does not understand REPLCONF listening-port: -NOAUTH Authentication required.
1:S 30 Jan 2025 16:50:15.031 * (Non critical) Master does not understand REPLCONF capa: -NOAUTH Authentication required.
1:S 30 Jan 2025 16:50:15.031 * Trying a partial resynchronization (request 8db103ec7633487b23a914fcb0ad5ede81073f0b:1).
1:S 30 Jan 2025 16:50:15.031 # Unexpected reply to PSYNC from master: -NOAUTH Authentication required.
1:S 30 Jan 2025 16:50:15.031 * Retrying with SYNC...
1:S 30 Jan 2025 16:50:15.031 # MASTER aborted replication with an error: NOAUTH Authentication required.
1:S 30 Jan 2025 16:50:15.031 * Reconnecting to MASTER 172.22.1.249:6379 after failure
1:S 30 Jan 2025 16:50:15.031 * MASTER <-> REPLICA sync started
...

Log with also masterpass $REDISPASS, where the last few lines are also repeated over and over again:

1:S 30 Jan 2025 16:52:08.958 * Before turning into a replica, using my own master parameters to synthesize a cached master: I may be able to synchronize with the new ma
ster with just a partial transfer.
1:S 30 Jan 2025 16:52:08.958 * Connecting to MASTER 172.22.1.249:6379
1:S 30 Jan 2025 16:52:08.958 * MASTER <-> REPLICA sync started
1:S 30 Jan 2025 16:52:08.958 * REPLICAOF 172.22.1.249:6379 enabled (user request from 'id=5 addr=172.22.1.3:58470 laddr=172.22.1.249:6379 fd=10 name= age=0 idle=0 flags=N db=0 sub=0 psub=0 ssub=0 multi=-1 watch=0 qbuf=46 qbuf-free=20428 argv-mem=23 multi-mem=0 rbs=16384 rbp=16384 obl=0 oll=0 omem=0 tot-mem=37807 events=r cmd=slaveof user=default redir=-1 resp=2 lib-name= lib-ver=')
1:S 30 Jan 2025 16:52:08.958 * Non blocking connect for SYNC fired the event.
1:S 30 Jan 2025 16:52:08.958 * Master replied to PING, replication can continue...
1:S 30 Jan 2025 16:52:08.959 * Trying a partial resynchronization (request a2e4d449bd8210525a1c78f08fd5707871a3438a:1).
1:S 30 Jan 2025 16:52:08.959 * Master is currently unable to PSYNC but should be in the future: -NOMASTERLINK Can't SYNC while not connected with my master
1:S 30 Jan 2025 16:52:09.888 * Connecting to MASTER 172.22.1.249:6379
1:S 30 Jan 2025 16:52:09.888 * MASTER <-> REPLICA sync started
1:S 30 Jan 2025 16:52:09.888 * Non blocking connect for SYNC fired the event.
1:S 30 Jan 2025 16:52:09.889 * Master replied to PING, replication can continue...
1:S 30 Jan 2025 16:52:09.889 * Trying a partial resynchronization (request a2e4d449bd8210525a1c78f08fd5707871a3438a:1).
1:S 30 Jan 2025 16:52:09.889 * Master is currently unable to PSYNC but should be in the future: -NOMASTERLINK Can't SYNC while not connected with my master
1:S 30 Jan 2025 16:52:10.894 * Connecting to MASTER 172.22.1.249:6379
1:S 30 Jan 2025 16:52:10.894 * MASTER <-> REPLICA sync started
...

Steps to reproduce:

1. Download the latest code (I have `de6bd22`).
2. Update your `mailcow.conf` to include `REDISPASS` of course.
3. Run `docker compose up --force-recreate --build redis rspamd`.
4. Issue a curl command for rspamd to scan an email.
5. Run `docker logs -f redis-mailcow` to see the errors.

Which branch are you using?

master

Which architecture are you using?

x86

Operating System:

Debian bookworm

Server/VM specifications:

16gb memory, 1tb drive

Is Apparmor, SELinux or similar active?

No

Virtualization technology:

NA

Docker version:

27.4.1

docker-compose version or docker compose version:

v2.32.1

mailcow version:

2025-01

@cr3 cr3 added the bug label Jan 30, 2025
@FreddleSpl0it
Copy link
Collaborator

FreddleSpl0it commented Jan 31, 2025

Could you share your Redis master and slave configuration files?

this are the redis slave logs, right?

1:S 30 Jan 2025 16:52:08.958 * Before turning into a replica, using my own master parameters to synthesize a cached master: I may be able to synchronize with the new ma
ster with just a partial transfer.
1:S 30 Jan 2025 16:52:08.958 * Connecting to MASTER 172.22.1.249:6379
1:S 30 Jan 2025 16:52:08.958 * MASTER <-> REPLICA sync started
1:S 30 Jan 2025 16:52:08.958 * REPLICAOF 172.22.1.249:6379 enabled (user request from 'id=5 addr=172.22.1.3:58470 laddr=172.22.1.249:6379 fd=10 name= age=0 idle=0 flags=N db=0 sub=0 psub=0 ssub=0 multi=-1 watch=0 qbuf=46 qbuf-free=20428 argv-mem=23 multi-mem=0 rbs=16384 rbp=16384 obl=0 oll=0 omem=0 tot-mem=37807 events=r cmd=slaveof user=default redir=-1 resp=2 lib-name= lib-ver=')
1:S 30 Jan 2025 16:52:08.958 * Non blocking connect for SYNC fired the event.
1:S 30 Jan 2025 16:52:08.958 * Master replied to PING, replication can continue...
1:S 30 Jan 2025 16:52:08.959 * Trying a partial resynchronization (request a2e4d449bd8210525a1c78f08fd5707871a3438a:1).
1:S 30 Jan 2025 16:52:08.959 * Master is currently unable to PSYNC but should be in the future: -NOMASTERLINK Can't SYNC while not connected with my master
1:S 30 Jan 2025 16:52:09.888 * Connecting to MASTER 172.22.1.249:6379
1:S 30 Jan 2025 16:52:09.888 * MASTER <-> REPLICA sync started
1:S 30 Jan 2025 16:52:09.888 * Non blocking connect for SYNC fired the event.
1:S 30 Jan 2025 16:52:09.889 * Master replied to PING, replication can continue...
1:S 30 Jan 2025 16:52:09.889 * Trying a partial resynchronization (request a2e4d449bd8210525a1c78f08fd5707871a3438a:1).
1:S 30 Jan 2025 16:52:09.889 * Master is currently unable to PSYNC but should be in the future: -NOMASTERLINK Can't SYNC while not connected with my master
1:S 30 Jan 2025 16:52:10.894 * Connecting to MASTER 172.22.1.249:6379
1:S 30 Jan 2025 16:52:10.894 * MASTER <-> REPLICA sync started

@cr3
Copy link
Author

cr3 commented Jan 31, 2025

I'm only running the single redis-mailcow container as defined in the docker-compose.yml file in the mailcow-dockerized repository, revision de6bd22, that is defined like this:

   redis-mailcow:
      image: redis:7-alpine
      entrypoint: /redis-conf.sh
      volumes:
        - redis-vol-1:/data/
        - ./data/conf/redis/redis-conf.sh:/redis-conf.sh:z
      restart: always
      depends_on:
        - netfilter-mailcow
      ports:
        - "${REDIS_PORT:-127.0.0.1:7654}:6379"
      environment:
        - TZ=${TZ}
        - REDISPASS=${REDISPASS}
      sysctls:
        - net.core.somaxconn=4096
      networks:
        mailcow-network:
          ipv4_address: ${IPV4_NETWORK:-172.22.1}.249
          aliases:
            - redis

That entrypoint script defined in ./data/conf/redis/redis-conf.sh in the repository creates a single configuration file, /redis.conf in the container that contains the single line, requirepass $REDISPASS. That is the only configuration file that I can see inside the container after looking for other potential files with the command find / -name \*redis\*. You are rightly assuming that I have two hosts, a master and a slave, whereas I actually only have a single host as defined in the above default docker-compose.yml configuration.

@cr3
Copy link
Author

cr3 commented Jan 31, 2025

In case it might be useful, here is the replication info from the redis-mailcow container:

127.0.0.1:6379> info replication
# Replication
role:master
connected_slaves:0
master_failover_state:no-failover
master_replid:c8ef1a113fb9357340293607ed4cf84711e0da91
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:0
second_repl_offset:-1
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

@cr3
Copy link
Author

cr3 commented Jan 31, 2025

Aha! The problem was on my side where I set the REDIS_SLAVEOF_IP and REDIS_SLAVEOF_PORT to the master IP and port respectively by mistake. I'll just close this bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants