rsync stopped working
For some reason from one day to another, after it has been working for months (or maybe years), rsync has stopped working. I'm using a cronjob (but running from the CLI has the same result) to sync files between two servers:
rsync -au --delete --exclude '.htaccess' --exclude 'error_log' -e ssh domain.net/ account@{my_ip}:domain.net
Suddenly (since the 24th of March) I'm getting:
ssh_exchange_identification: read: Connection reset by peer
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]
I didn't change anything on my end. The only purpose of this script is to make sure that the failover server has the same files as the main server. The DB is synced in real time.
-
Hey there! This doesn't seem like it would be related to cPanel since this happens manually on the command line as well. However, this does sound like a firewall issue of some sort since the connection drops. Are you able to just run the SSH connection portion of the command between the two systems?
1 -
No, I'm not. I get the same error message: ssh_exchange_identification: read: Connection reset by peer
0 -
Well that's good then - that confirms the issue isn't related to cPanel or rsync or SSH, but a connection problem between the two systems. You'll want to check the firewall on both ends and see what could be blocking that connection.
1 -
Thanks a lot cPRex. I thought it was that, and verified my firewall on both ends, so it's probably related to the DC. I've contacted them.
0 -
Hopefully they'll be able to take care of that quickly!
0 -
They were not. 9 days later: "It was possible though, to connect to the server after changing the SSH port. So this indicates, its not a issue on the underlaying system but rather on the servers itself."
Any suggestion about how to fix this?
BTW Does it make sense that suddenly I have to change the SSH port when it has been working for a long time?
0 -
It sounds like there were some external firewall issues they aren't telling you about, as that could explain both the rsync problem and the need for an SSH port change. No, it doesn't make sense that you would suddenly need to change the SSH port after it's been working for years.
0 -
Their response:
Thank you for contacting Contabo support.
On a network basis, there are no restrictions from our side at all. We do not block any ports, but please consider that before a port will be open, you must install and activate a service on this port (for instance a web server).
In most cases you did either install a firewall like ufw and forgot to open the port, or you did not yet install a mailserver that listens to the port, so it appears to be down. Or the configuration is wrong.
If a port actually appears to be blocked, this could only be caused by a specific firewall setting on your server and you would have to adjust your firewall configuration in that regard.So they didn't help in any way. Finally, the solution was:
rsync -au --delete --exclude '.htaccess' --exclude 'error_log' '-e sshpass -f pass_file ssh -p 22223' domain.net/ account@{my_ip}:domain.netMany thanks to Yalın YALNIZ. He helped me a lot (and for much less than Contabo).
1
Please sign in to leave a comment.
Comments
8 comments