Error condition on socket for SYNC: Operation now in progress

ENVIRONMENT
redis total nodes = 3

ISSUE

15584:S 24 Sep 2020 17:25:04.424 * Connecting to MASTER 192.168.3.134:6379
15584:S 24 Sep 2020 17:25:04.424 * MASTER <-> REPLICA sync started
15584:S 24 Sep 2020 17:25:04.424 # Error condition on socket for SYNC: Operation now in progress

/etc/redis1.conf of SLAVE file

protected-mode no
port 6379
replicaof 192.168.3.134 6379
bind 0.0.0.0

/etc/redis1.conf of MASTER file

protected-mode no
port 6379
bind 0.0.0.0

REDIS MASTER

127.0.0.1:6379> info replication

Replication

role:master
connected_slaves:0
master_replid:a806ec554daec8ac1cf1af7a3a12ccfb8f4e30d0
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

REDIS SLAVE

127.0.0.1:6379> info replication

Replication

role:slave
master_host:192.168.3.134
master_port:6379
master_link_status:down
master_last_io_seconds_ago:-1
master_sync_in_progress:0
slave_repl_offset:1
master_link_down_since_seconds:1600950423
slave_priority:100
slave_read_only:1
connected_slaves:0
master_replid:1a633bd5dc4b87b8efe59ef4e493a01e411d7f71
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

@z_haseeb not sure what you are trying to setup here, are you trying to setup a redis cluster, since you mentioned total node = 3, or is it just 1 master with 2 slaves ?

When did you encounter this issue - was it after a delete/reinstall? Perhaps this could be of help to you: https://github.com/bitnami/charts/issues/2697

Also, it could be SSL issue: https://bugzilla.redhat.com/show_bug.cgi?id=1518126

My setup is simple. I want to make one Primary with two Slaves. I assume that the behavious of REDIS replication configuration is not stable.

I also disable the TLS on all machines but same result. i.e., link is down

127.0.0.1:6379> CONFIG GET tls-auth-clients

  1. “tls-auth-clients”
  2. “no”
    127.0.0.1:6379>

info replication
# Replication
role:master
connected_slaves:0

Hi @z_haseeb

Probably you can try the following guides and tutorials to see if it would allow you to setup redis.


Master IP 192.168.3.134
SLAVE IP 192.168.3.237

Already followed same configurations which you shared in the web post above, but master unable to see slaves. However the slaves able to see Master

/etc/redis.conf [SLAVE FILE]

protected-mode no
port 6379
replicaof 192.168.3.134 6379
bind 127.0.0.1 192.168.3.237
supervised systemd

/etc/redis.conf [MASTER FILE]

protected-mode no
port 6379
bind 127.0.0.1 192.168.3.134
supervised systemd

Furthermore, I am also not able to connect from SLAVE to MASTER even the firewalld and selinux is disabled on all machines. Below is the reference:

SLAVE TO MASTER
[root@redis-c ~]# redis-cli -h 192.168.3.134 -p 6379
Could not connect to Redis at 192.168.3.134:6379: Connection refused
Could not connect to Redis at 192.168.3.134:6379: Connection refused

MASTER TO MASTER ITSELF
[root@redis-a ~]# redis-cli -h 192.168.3.134 -p 6379
Could not connect to Redis at 192.168.3.134:6379: Connection refused
Could not connect to Redis at 192.168.3.134:6379: Connection refused

I think this is due to a misconfiguration in your redis:

Can you try below if it would work, for both your master/slave?

Before (file /etc/redis/redis.conf )

bind 127.0.0.1

After

bind 0.0.0.0

Currently its one master and two slaves. After that I will go for a cluster setup. Bus this time I only want to make replication.

Noted. I assume after binding to 0.0.0.0 it works?

The issue with Could not connect to Redis at 192.168.3.134:6379: Connection refused is due to network binding. If it’s bind to 127.0.0.1, only redis instances within the same machine (localhost) can connect.

Dear Team, my issue is resolved. Earlier I write all configurations at the top of replica’s and master machines configuration file. However right now I modify the configurations of Master and Replica’s at the line where the configurations exist. Suppose a setting is mentioned like protected-mode = yes then I modify it to no.

1 Like

Unfortunately many users fail to protect Redis instances from being accessed from external networks. Many instances are simply left exposed on the internet with public IPs. For this reasons since version 3.2.0, when Redis is executed with the default configuration (binding all the interfaces) and without any password in order to access it, it enters a special mode called protected mode . In this mode Redis only replies to queries from the loopback interfaces, and reply to other clients connecting from other addresses with an error, explaining what is happening and how to configure Redis properly.