Bobcares

Rsync error code 255 – Quick fixes

by | Sep 23, 2019

My server backup task is failing with this error. Please fix!
rsync: [sender] write error: Broken pipe (32)
rsync error: unexplained error (code 255) at io.c(837) [sender=3.1.0]

That was a recent request we received as part of our Server Management Services.

Often, this rsync error happens due to bad ssh settings on the server.

Today, let’s get into the details and see how our Support Engineers fix rsync error code 255.

 

How to use rsync?

Basically, Rsync is a Linux-based tool for synchronizing documents between remote and local servers.

It becomes really popular as it will only sync or copy the changes from source to the destination. Thus it saves the effort of copying the whole file. Consequently, the command ultimately reduces the amount of data sent over a network.

A sample rsync over ssh command to perform backups to a remote server looks as

rsync -azLvv --progress -e 'ssh -p22 -vvv' --exclude 'xxx' /home/user/ server.tld:/backup/DIR

It copies the folder /home/user to the remote server.

However, an error may occur while using the rsync command.

 

How we fix common rsync errors

At Bobcares, where we have more than a decade of expertise in managing servers, we see many customers face problems while running the rsync command.

Now let’s see the major reasons for rsync errors and how our Support Engineers fix the top errors.

 

1. Bad ssh configuration

Recently, one of our customers had a problem while executing the rsync command. He got an error like below

rsync: [sender] write error: Broken pipe (32)
rsync error: unexplained error (code 255) at io.c(837) [sender=3.1.0]

Broken pipe error most likely means that the server hit a timeout in SSH. It generally means that there is a bad setting in the ssh configuration file.

Then, our Support Engineers first check whether the ssh configuration was set up correctly. Most of the time customers may forget to set up the settings in the local ~/.ssh/config file.

This will create problems like timeout while synchronizing large files. Here, the fix was to add the keep-alive options. So, we added the following lines in the local ~/.ssh/config file.

Host *
ServerAliveInterval 30
ServerAliveCountMax 6

Again, on the remote server, we added these in the /etc/ssh/sshd_config file.

ClientAliveInterval 30
ClientAliveCountMax 6

That fixed the error and resumed the rsync process.

 

2. Incorrect Syntax

Similarly, another customer has requested us to solve a rsync error such as Rsync stopped working and returns “rsync error: unexplained error.

On investigating, our Support Engineers found the detailed error as:

Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(605) [sender=3.0.9]

Also, because of the use of bad syntax as misplaced double quotes ” in the command, this error occurred. So, we corrected as below.

rsync -rdtvu --delete -e "ssh -p 22 -i /path/to/sshkey" /media/local/xxx/ user@1xx.21x.0.1:/xxxx/remote/dir/

Hence, the problem was fixed. When the server uses a non-standard SSH port, we always take special care in ensuring the correct setting in the port.

 

3. Firewall settings

Often firewall settings also create problems and report Rsync error code 255.

In such cases, our Dedicated Engineers first run the rsync command in verbose mode. It usually shows the port restrictions. A sample output appears as:

[root@srv]$ sudo ssh -vvv server@1xx.1yy.1.102
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to 1xx.1yy.1.102 [1xx.1yy.1.102] port 22.
debug1: connect to address 1xx.1yy.1.102 port 22: Connection refused
ssh: connect to host 1xx.1yy.1.102 port 22: Connection refused

Then, we make adequate modifications to the firewall. For already blocked IP addresses, we unban in Fail2ban using the following command.

fail2ban-client set JAILNAME unbanip IPADDRESS

 

[Need assistance to fix rsync errors? We’ll help you.]

 

Conclusion

In short, rsync error code 255 may occur if the server has a bad ssh setup or if the rsync command has syntax errors. Today, we saw the top reasons for the rsync error and how our Support Engineers fixed it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF