Rsync error unexplained error code 255 at io c

Rsync error code 255 may occur if the server has a bad ssh setup or if the data is transferred using a wrong syntax, firewall rules, etc.
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»;

Good day everyone. I’m trying to rsync to my Manjaro server over ssh. Nothing fancy, just a single PNG in order to verify that it works. I’m using a basic password authentication in order to verify that I can get it functioning before I start packing on extra security.

rsync -v -e ssh /home/john/rsyncdemo/rsyncdemo2/saved.png sshuser@192.162.2.187:/home/sshuser/Desktop/rsyncdemo/rsyncdemo2/saved.png

When I do that, about 10 seconds go by until I receive the following error.

ssh: connect to host 192.162.2.187 port 22: Connection timed out
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’m no stranger to ssh but this is something beyond my modest understanding of the deep inner workings. I googled the problem but I didn’t want to throw arbitrary solutions at my system without first understanding the problem. I’ll explain what I have done in order to gather more information. I have 3 systems.

  1. Win10-PC with Cygwin (fully updated) (Atheros Wireless)
  2. Arch-Laptop (fully updated) (Atheros Wireless)
  3. Manjaro-Server (fully updated) (Wired)

+router

  • ASUS RT-N10P

First thing I checked was sshd. Enabled and restarted sshd on all 3 machines. It’s worth noting that my Manjaro is a brand spanking new install. Arch has been modified but the system is very minimal. Cygwin is also new but It’s been awhile since I reinstalled Windows and I have a few things running in the background. I also forwarded the ports and disabled the firewall on my router.

Ran the three commands.

ssh sshuser@192.162.2.187

rsync -r /cygdrive/c/Users/John/Desktop/rsyncdemo/ /cygdrive/e/rsyncdemo/

scp /cygdrive/c/Users/John/Desktop/rsyncdemo/rsyncdemo2/saved.png sshuser@192.168.2.187:/home/sshuser/Desktop/rsyncdemo/rsyncdemo2/

All of these commands work. What that means is that: logging into the machine via ssh works, copying files to the server works and rsync works. The problem exists when I try to rsync via ssh. One of two possibilities exists. Either there is something wrong with the server, or I missed some fundamental step in configuring ssh on both client computers. It’s more likely the former. Like I said, I had prior experience setting up ssh and it wasn’t that hard the first few times. I started by checking the ssh and rsync versions I was running.

Win10-PC (sshd enabled and started)

OpenSSH_7.5p1, OpenSSL 1.0.2k  26 Jan 2017

Arch-Laptop (sshd enabled and started)

OpenSSH_7.5p1, OpenSSL 1.1.0f  25 May 2017

Manjaro-Server (sshd enabled and started)

OpenSSH_7.5p1, OpenSSL 1.1.0f  25 May 2017

All 3 machines

rsync  version 3.1.2  protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, prealloc

You may have noticed the Cygwin version of openssl is not as high as the other two. I don’t think this could cause the problem since Arch also can not connect to the network. Like I said before, Either there is something wrong with the server, or I missed some fundamental step in configuring ssh on both client computers.

I also read this thread but I’m not sure if the chosen answer wants me to configure the ssh_config file on the host of the client. In either case, a simple png should not take this long to rsync so I doubt it has anything to do with the problem but I’ll leave it here in just in case

rsync timed out

If you have an answer off the top of your head, awesome. If you don’t, then posting something that can help further isolate the problem would be equally appreciated. Thank you so much for your help.

When I try to rsync -qaPH source/ 192.168.1.21:/var/backups I get

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

Whats wrong with my command?

asked Nov 29, 2014 at 22:10

Alex's user avatar

1

To investigate, add one or more -v options to the rsync command.
Also, try to use plain ssh:

ssh -v 192.168.1.21 /bin/true

to find out whether it is rsync or the underlying ssh connection that is causing the trouble.

answered May 18, 2015 at 8:38

Arjen's user avatar

ArjenArjen

3663 silver badges5 bronze badges

1

255 is actually not a «native» rsync return code. rsync scrapes the 255 error code from SSH and returns it. It looks to me like something on the destination server is blocking SSH or breaking it once it’s connected, hence, «broken pipe». I disagree with @kenorb because if it were a timeout issue you would probably be seeing rsync exit codes 30 or 35.

answered Jul 19, 2017 at 18:30

medley56's user avatar

medley56medley56

2152 silver badges10 bronze badges

Broken pipe error most likely means that you’ve hit the timeout. For example the remote rsync command started to calculate the file differences, but it didn’t replied to the client on time.

If this happens very often, add these settings to your local ~/.ssh/config:

Host *
  ServerAliveInterval 30
  ServerAliveCountMax 6

and on the remote server (if you’ve got the access), setup these in your /etc/ssh/sshd_config:

ClientAliveInterval 30
ClientAliveCountMax 6

See: What the options ServerAliveInterval and ClientAliveInterval mean?

Community's user avatar

answered Dec 2, 2016 at 20:10

kenorb's user avatar

kenorbkenorb

9,6362 gold badges74 silver badges88 bronze badges

I got the 255 error when rsnapshot using rsync encountered the situation «The ECDSA host key for foobar has changed». The rest of the error message included «POSSIBLE DNS SPOOFING DETECTED» and «REMOTE HOST IDENTIFICATION HAS CHANGED».

I had recreated my server and so the fingerprint had changed. I removed the ECDSA key (ssh-keygen -f "/home/bruce/.ssh/known_hosts" -R "foobar") and agreed to the new one when I sshed into foobar again.

ssh -vvv foobar gave me the info I needed to see this issue.

Pilot6's user avatar

Pilot6

86.1k89 gold badges196 silver badges303 bronze badges

answered May 12, 2022 at 12:45

Bruce's user avatar

BruceBruce

111 bronze badge

I know this issue is old, but maybe someone (like me) still have the error.

a) Check if the ssh service is running:

sudo service ssh status

b) Check the connection with triple verbose command:

ssh -vvv <hostname>

c) Maybe you use the wrong ssh-key or the key is broken in some way.

Vine

answered May 4, 2017 at 8:06

vine's user avatar

I had a similar error using rsync via my deploy for an Ember app (ember-cli-deploy). I had to configure correctly my ssh (add private keys to my ~/.ssh/)

answered Oct 26, 2017 at 14:38

morhook's user avatar

morhookmorhook

1,52713 silver badges21 bronze badges

Содержание

  1. необъяснимая ошибка rsync (код 255) в io.c
  2. Rsync pull — Host key verification failed
  3. Thread: ssh/rsync issues
  4. ssh/rsync issues
  5. Re: ssh/rsync issues
  6. Re: ssh/rsync issues
  7. Re: ssh/rsync issues
  8. Re: ssh/rsync issues
  9. Re: ssh/rsync issues
  10. Re: ssh/rsync issues
  11. Re: ssh/rsync issues
  12. Re: ssh/rsync issues
  13. Thread: ssh/rsync issues
  14. ssh/rsync issues
  15. Re: ssh/rsync issues
  16. Re: ssh/rsync issues
  17. Re: ssh/rsync issues
  18. Re: ssh/rsync issues
  19. Re: ssh/rsync issues
  20. Re: ssh/rsync issues
  21. Re: ssh/rsync issues
  22. Re: ssh/rsync issues

необъяснимая ошибка rsync (код 255) в io.c

Я использовал скрипт для выполнения rsync в sudo crontab . Сценарий выполняет двухстороннюю rsync (от сервера A к серверу B и обратно). После перезагрузки обоих серверов сервер rsync не работает sudo crontab . Я также установил новый cronjob, и он не работает, ошибка:

Однако при запуске из терминала скрипт rync работает, как и ожидалось, без проблем. пожалуйста помоги.

Немного трудно ответить, учитывая почти полное отсутствие соответствующей информации, но, как правило, если команда работает из приглашения, а не из задания cron, это потому, что вам нужно указать полный путь к команде (ям). Задания Cron не имеют нормальной пользовательской среды, что особенно означает, что они не имеют такой же PATH, как у обычных пользователей.

Это происходит, когда в соединении отказано:

SSH: подключиться к хост-порту 2222: соединение отказано

с последующей rsync ошибкой:

rsync: соединение неожиданно закрыто (пока получено 0 байт) [получатель] ошибка rsync: необъяснимая ошибка (код 255) в /SourceCache/rsync/rsync-45/rsync/io.c(453) [получатель = 2.6.9]

Возможные причины:

  • В моем сценарии у меня была проблема с брандмауэром. Пробил дыру.
  • неверный пароль (вряд ли решит вашу проблему, но вызовет ту же ошибку)

Одной из причин rsync неожиданного закрытия соединения является проблема тайм-аута, особенно когда требуется некоторое время для вычисления контрольных сумм файлов, чтобы проверить различия на удаленном хосте.

Чтобы избежать этой проблемы, вам нужно добавить эти настройки в ваш

/.ssh/config или /etc/ssh/ssh_config :

и необязательно аналогично на удаленном сервере (в /etc/ssh/sshd_config ), например

Источник

Rsync pull — Host key verification failed

I have set up an Rsync job to backup my Nextcloud data folder (NC running on a Raspberry Pi on my local network) to my OMV server. So far I did the following:
— As the Nextcloud data folder is owned by www-data, I created a user «NCrsync» on the Pi and added it to the www-data group
— In the OMV GUI, I created a new SSH key and tried to copy the public key to the Pi which failed as the GUI can’t handle the «Trust this RSA key» prompt. So I created the file /home/NCrsync/.ssh/authorized_keys on the Pi, copied the public key from the OMV GUI and pasted it into this file
— Set up an Rsync job in the OMV gui with the following settings:

However, if I start the Rsync job, it fails:

Please wait, syncing to

Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(235) [Receiver=3.1.2]

The synchronisation has completed successfully.
Done .

What could be the reason for this to fail?

Thank you very much in advance!

Does anyone have an idea?

Well, something went wrong with the key exchange.
The easiest way I know is to simply use
ssh-copy-id NCrsync@

This will allow to connect to your pi without getting asked for the password, until keys change.
If it is only about key verification just log in via ssh once and accept the key so it gets written into know_hosts.
Also you should use lower case user names only, upercase may cause unexpected behaviour.

Also if a windows computer is involved when copying/editing that may have borked some file. Bad coding/newlines.

Be smart — be lazy. Clone your rootfs.
OMV 5: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4

I have set up an Rsync job to backup my Nextcloud data folder (NC running on a Raspberry Pi on my local network) to my OMV server. So far I did the following:

I have set up an Rsync job to backup my Nextcloud data folder (NC running on a Raspberry Pi on my local network) to my OMV server. So far I did the following:
— As the Nextcloud data folder is owned by www-data, I created a user «NCrsync» on the Pi and added it to the www-data group
— In the OMV GUI, I created a new SSH key and tried to copy the public key to the Pi which failed as the GUI can’t handle the «Trust this RSA key» prompt. So I created the file /home/NCrsync/.ssh/authorized_keys on the Pi, copied the public key from the OMV GUI and pasted it into this file
— Set up an Rsync job in the OMV gui with the following settings:

However, if I start the Rsync job, it fails:

What could be the reason for this to fail?

Thank you very much in advance!

Did you ever manage to get this to work?

I tried creating an SSH certificate and copy it to the remote server with build in tool. It didn’t work, I am guessing, because of the issue you mentioned. I then tried copying the certificate to authorized_keys of the remote server. Even when I try to SSH to that server it doesn’t work let alone rsync. So I created an SSH key using the old method with ssh-keygen and copied it to the remote server. Validated that I could login without password. Updated everything in Rsync page but I still can’t get Rsync to work.

Please wait, syncing to .

Host key verification failed.
rsync: did not see server greeting
rsync error: error starting client-server protocol (code 5) at main.c(1666) [Receiver=3.1.2]

The synchronisation has completed successfully.

Done .
I tested a manual Rsync command and it seems to run just fine. So I am not sure what’s wrong with the inbuilt tool.

hi
For the archive and others with this problem.

go to the OMV server via SSH as root. «root@ «
connect via SSH to your RSYNC server. «@

«
accept the hostkey by entering ‘yes’
login or disconnect.

The problem is a missing entry for the hostkey in /root/.ssh/known_hosts.
under OMV Rsync runs as root

No luck with this

I have been using OMV 4 for a year and set up a rsync job using the web interface of OMV. Now, with OMV 5.3.5-1, I can’t. I always get the same result:

What I’m trying to set is a rsync job between a PC (Ubuntu 18.04) that I use as a media server and OMV 5 as a remote backup server (local network) installed into a Raspberry with two HD connected by USB. It worked for a long time but now I can’t do it again.

I have also done:

(then, accepted the new fingerprint)

And also the opposite way:

(then, accepted the new fingerprint)

Help anybody? Probably the problem is caused by something obvious but I’ve spent a week trying to figure it out with no luck

Edited once, last by Itookmyprozac ( Mar 1st 2020 ).

Just in case someone arrive here from google. What I have done to solve this (I don’t know if it’s the right thing to do but nobody has told me anything here, so. ) and has worked is:

1. Install samba in my media server (Ubuntu 18.04), from where I want to copy the files to backup. Edit smb.conf to share the directories where the files are.
2. In OMV5, install the remote mount plugin and create the mount points (the directories shared by the media server) and reboot omv. If I don’t reboot it does not work.
3. Create the shared folders in OMV (every folder of the media server that I want to copy and every folder in OMV where I want to put the backup).
4. rsync local folders (the remote points and the local folders where I want to move the backup).

When I used OMV 4 it was way easier to achieve this, but now I have to do all this to get the same results. Not cool

Better solution. Actually, the right solution:

1. Generate certificate ssh (System > Certificates).
2. Copy it into the media server (from where I want to get the copies).
3. Create the rsync jobs (pulling method) selecting ‘Public key’ as a Authentication method and select your certificate.

Edited 2 times, last by Itookmyprozac: Update ( Mar 8th 2020 ).

Источник

Thread: ssh/rsync issues

Thread Tools
Display

ssh/rsync issues

So i recently updated my server from 10.04 to 12.04. I had a script that I used to backup and sync my music from my laptop to the server

rsync and openssh are installed on both machines and googling has turned up nothing so far. any ideas?
I can vnc into the box no problem

Last edited by djyoung4; October 16th, 2012 at 09:52 PM .

Re: ssh/rsync issues

Let’s try to make sure your ssh connection is working OK.

Could you post the result of an ssh connection using the triple verbose option?

Re: ssh/rsync issues

Re: ssh/rsync issues

It look like the ssh service is not running, or set to use another port.

Could you post the results of these commands on the server?

Re: ssh/rsync issues

ha seems to be my problem

Re: ssh/rsync issues

The server side of the openssh package has not been installed yet on the server.

Install it like this:

Let us know how it goes.
Regards.

Re: ssh/rsync issues

I cant seem to figure out where to add the new RSA key. Hopefully someone isn’t really doing something nasty.
edit: I added it in the file and ran the script and still no luck. just gave me some other errors and then closed the terminal before I could copy them

Last edited by djyoung4; October 16th, 2012 at 10:38 PM .

Re: ssh/rsync issues

Either remove the second line of your

/.ssh/know_hosts, or just remove the file (if you don’t ssh to other machines).

Try again, and let us know how it goes.
Regards.

Re: ssh/rsync issues

I think you’re getting that because your system is recognizing that the server has changed and now has a different key. If purge the server’s entry from

/.ssh/known_hosts you should be OK again.

If you can’t decipher which is the server’s (which is not unlikely!) I think you can just purge the whole file. The only downside side that I’ve seen is that you just have to say «yes» to add a key when connecting to a server that you’ve connected to before. You can test by just backing the file up before you delete it (just changing the name is enough).

Источник

Thread: ssh/rsync issues

Thread Tools
Display

ssh/rsync issues

So i recently updated my server from 10.04 to 12.04. I had a script that I used to backup and sync my music from my laptop to the server

rsync and openssh are installed on both machines and googling has turned up nothing so far. any ideas?
I can vnc into the box no problem

Last edited by djyoung4; October 16th, 2012 at 09:52 PM .

Re: ssh/rsync issues

Let’s try to make sure your ssh connection is working OK.

Could you post the result of an ssh connection using the triple verbose option?

Re: ssh/rsync issues

Re: ssh/rsync issues

It look like the ssh service is not running, or set to use another port.

Could you post the results of these commands on the server?

Re: ssh/rsync issues

ha seems to be my problem

Re: ssh/rsync issues

The server side of the openssh package has not been installed yet on the server.

Install it like this:

Let us know how it goes.
Regards.

Re: ssh/rsync issues

I cant seem to figure out where to add the new RSA key. Hopefully someone isn’t really doing something nasty.
edit: I added it in the file and ran the script and still no luck. just gave me some other errors and then closed the terminal before I could copy them

Last edited by djyoung4; October 16th, 2012 at 10:38 PM .

Re: ssh/rsync issues

Either remove the second line of your

/.ssh/know_hosts, or just remove the file (if you don’t ssh to other machines).

Try again, and let us know how it goes.
Regards.

Re: ssh/rsync issues

I think you’re getting that because your system is recognizing that the server has changed and now has a different key. If purge the server’s entry from

/.ssh/known_hosts you should be OK again.

If you can’t decipher which is the server’s (which is not unlikely!) I think you can just purge the whole file. The only downside side that I’ve seen is that you just have to say «yes» to add a key when connecting to a server that you’ve connected to before. You can test by just backing the file up before you delete it (just changing the name is enough).

Источник

I was using a script to perform rsync in sudo crontab. The script does a 2-way rsync (from serverA to serverB and reverse). After I reboot both the server machines, the rsync is not working in sudo crontab. I also setup a new cronjob and it fails, The error is:

rsync error: unexplained error (code 255) at io.c(600) [sender=3.0.6]
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]

However, when run from terminal, the rync script works as expected without issues. please help.

Rahul's user avatar

Rahul

671 silver badge12 bronze badges

asked Nov 12, 2012 at 2:46

kabeer's user avatar

One of the reason of rsync connection being unexpectedly closed is the timeout issue, especially when it takes a while to calculate file checksums in order to check the differences on the remote host.

To avoid this problem, you need to add these settings into your ~/.ssh/config or /etc/ssh/ssh_config:

Host *
  ServerAliveInterval 30
  ServerAliveCountMax 6

and optionally similar on the remote server (in /etc/ssh/sshd_config), e.g.

ClientAliveInterval 30
ClientAliveCountMax 6

See: What the options ServerAliveInterval and ClientAliveInterval mean?

Community's user avatar

answered Dec 2, 2016 at 22:36

kenorb's user avatar

kenorbkenorb

6,2031 gold badge44 silver badges53 bronze badges

2

A little hard to answer given the almost total lack of relevant information but as a general rule, if a command works from the prompt but not from a cron job it’s because you need to specify the full path to the command(s). Cron jobs do not have a normal user environment, which especially means they don’t have the same PATH as regular users do.

answered Nov 12, 2012 at 5:47

John Gardeniers's user avatar

John GardeniersJohn Gardeniers

27.4k12 gold badges54 silver badges109 bronze badges

1

This appears to happen when the connection is refused:

ssh: connect to host port 2222: Connection refused

followed by rsync error:

rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: unexplained error (code 255) at /SourceCache/rsync/rsync-45/rsync/io.c(453) [receiver=2.6.9]


Possible reasons:

  • In my scenario, I had a firewall issue. Punched a hole.
  • wrong password (unlikely to address your issue, but will cause the same error)

answered Dec 29, 2015 at 7:49

SwiftArchitect's user avatar

Please look at you fail2ban list.

use the command: «fail2ban-client set YOURJAILNAMEHERE unbanip IPADDRESSHERE» to unban it and try again.

womble's user avatar

womble

95.6k29 gold badges173 silver badges229 bronze badges

answered Jan 5, 2018 at 21:36

Linkinall's user avatar

I have similar issues too, while I was sending roughly 50GB of data through the local network with the command

rsync -avhPW --progress . user@192.168.1.233:/path/to/target

The pipe broke a few times, but for the first few times I could just relaunch the command. However, after ~20 hours, the command stopped working with unexplained error. rsync didn’t even compute the list of files of consideration. It is not the problem of timeout either — the target machine never received a request. I ended up rebooting the source machine. That made rsync work again.

answered Sep 5, 2022 at 21:49

Student's user avatar

Out of the blue, upon vagrant up, rsync started throwing the error below:

There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /c/Users/David/Sandbox/citypantry/frontend/
Guest path: /home/citypantry/project/frontend
Command: rsync --verbose --archive -z --copy-links --chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o ControlMaster=auto -o ControlPath=C:/bin/cygwin64/tmp/ssh.588 -o ControlPersist=10m -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o UserKnownHostsFile=/dev/null -i 'C:/Users/David/Sandbox/citypantry/vagrant/.vagrant/machines/default/virtualbox/private_key' --exclude .vagrant/ --exclude app/cache/ --exclude app/logs/ --exclude node_modules /c/Users/David/Sandbox/citypantry/frontend/ vagrant@127.0.0.1:/home/citypantry/project/frontend
Error: Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
select: Interrupted system call
rsync: [sender] write error: Broken pipe (32)
rsync error: unexplained error (code 255) at io.c(820) [sender=3.1.1]

This is Windows 10 running a cygwin (x64) with rsync 3.1.1 on ConEmu (x64). Nothing that I know of has changed in the system and the sync has worked for weeks without any problems.

What does this error mean and how can I fix it?

asked Dec 26, 2015 at 10:04

David's user avatar

1

Looks like a problem with Vagrant 1.8.0: https://github.com/mitchellh/vagrant/issues/6702

Updating it should solve the problem. If you can’t then the workaround is to edit $VAGRANT_HOMEembeddedgemsgemsvagrant-1.8.0pluginssynced_foldersrsynchelper.rb and remove lines 77~79:

"-o ControlMaster=auto " +
"-o ControlPath=#{controlpath} " +
"-o ControlPersist=10m " +

answered Jul 13, 2016 at 11:55

ldnunes's user avatar

ldnunesldnunes

1793 silver badges14 bronze badges

The Broken pipe error usually happens when you hit the connection timeout. It can happen with rsync when it’s calculating the file differences on the remote and it didn’t respond to the client on time.

To avoid this, try increasing the server alive interval value in your SSH config (~/.ssh/config):

Host *
  ServerAliveInterval 30
  ServerAliveCountMax 6

Also consider doing similar on the remote (in /etc/ssh/sshd_config), e.g.

ClientAliveInterval 30
ClientAliveCountMax 6

See: What the options ServerAliveInterval and ClientAliveInterval mean?


Alternatively add the following keep alive line into your Vagrantfile:

config.vm.ssh.keep_alive = true

If you think it’s a control master issue, the recent Vagrant version ignore to use it on windows platforms.

Community's user avatar

answered Dec 2, 2016 at 20:25

kenorb's user avatar

kenorbkenorb

149k80 gold badges668 silver badges723 bronze badges

  • Печать

Страницы: [1] 2  Все   Вниз

Тема: Ошибка доступа при использовании rsync  (Прочитано 6271 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
Luca Brasi

Доброго времени. Стояла у меня простая задача, синхронизировать одну машину с другой. Сделал скрипт, задуман он так:

  • Монтируем каталоги сервера
  • Сихнхронизируем каталоги клиента с сервером
  • Демонтируем каталоги сервера

Ошибка возникает на этапе синхронизации.
Диски монтируются в режиме rw. Инфа успешно просматривается даже не от рута. Скрипт запускается от рута, однако все равно имеем
«rsync: readlink_stat(«/tmp/Дело/study») failed: Permission denied (13)»
Все пункты проверялись по-отдельности и имеют право на жизнь, но в скрипте почему то не работают. А конкретно:

« Последнее редактирование: 01 Июля 2017, 12:43:24 от Luca Brasi »

Ubuntu 18.04/ AMD Ryzen 5 2600 3.4GHz/ MSI B450-A Pro Max / Crucial DDR4-3000 16384MB / MSI PCI-Ex GeForce GT 710 2048 MB / Chieftec GPS-600


Оффлайн
Azure

Скрипт запускается от рута

Зачем тогда sudo внутри скрипта, тем более я не уверен что python его верно обработает?
2-е: rsync умеет работать по сети (сюрприз!), не понятно зачем делать mount|unmount?

В Линукс можно сделать ВСЁ что угодно, достаточно знать КАК !


Оффлайн
Luca Brasi

Azure, я не против отказаться от монтирования,однако

rsync -r -v 192.168.0.101:/media/Maindata/Книги /media/Maindata/Книги/
ssh: connect to host 192.168.0.101 port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(226) [Receiver=3.1.1]

Он что через SSH пытается зайти?

Ubuntu 18.04/ AMD Ryzen 5 2600 3.4GHz/ MSI B450-A Pro Max / Crucial DDR4-3000 16384MB / MSI PCI-Ex GeForce GT 710 2048 MB / Chieftec GPS-600


Оффлайн
Azure

через SSH пытается зайти?

Без знака вопроса. Так что запустите/настройте ssh-сервер и проблема решена

В Линукс можно сделать ВСЁ что угодно, достаточно знать КАК !


Оффлайн
Luca Brasi

Azure, хорошо, это я попробую.
В скрипте «sudo» убрал, оно там и вправду не к чему. А опции NFS в /etc/exports не могут палки в колеса вставлять? Теоретически, это должно обеспечивать синхронизацию?

/media/Maindata/Дело/    192.168.0.102 (rw,sync,no_subtree_check) 192.168.0.103 (rw,sync,no_subtree_check)

Ubuntu 18.04/ AMD Ryzen 5 2600 3.4GHz/ MSI B450-A Pro Max / Crucial DDR4-3000 16384MB / MSI PCI-Ex GeForce GT 710 2048 MB / Chieftec GPS-600


Оффлайн
AnrDaemon

$HOME/bin/rsyncd

$HOME/.rsyncd

Скрипт для скидывания данных на эту конфигурацию (Cygwin):

При работе через ssh враппер «address» игнорируется, прописан просто для совместимости с локальным сервером.
Если абсолютно требуется запускать rsync от рута, настройте ключи и запускайте. Ни в коем случае не ставьте руту пароль.

« Последнее редактирование: 01 Июля 2017, 17:50:27 от AnrDaemon »

Хотите получить помощь? Потрудитесь представить запрошенную информацию в полном объёме.

Прежде чем [Отправить], нажми [Просмотр] и прочти собственное сообщение. Сам-то понял, что написал?…


Оффлайн
Luca Brasi

Я настроил SSH, сгенерировал ключи. Когда делаю ssh user@host — все гуд, логинится без пароля. Стоит только мне:

rsync -rv -e "ssh -i /home/andrew/.ssh/id_rsa.pub" --update andrew@192.168.0.101:/media/Maindata/Книги /media/Maindata/Книги
И до фени все эти ключи. Снова просит пароль

Enter passphrase for key ‘/home/andrew/.ssh/id_rsa.pub’:
andrew@192.168.0.101’s password:

Нудно как-то. Можно обойтись без ввода пароля?

Ubuntu 18.04/ AMD Ryzen 5 2600 3.4GHz/ MSI B450-A Pro Max / Crucial DDR4-3000 16384MB / MSI PCI-Ex GeForce GT 710 2048 MB / Chieftec GPS-600


Оффлайн
AnrDaemon

делаю ssh user@host — все гуд

Стоит только мне:Код: [Выделить]rsync -rv -e «ssh -i /home/andrew/.ssh/id_rsa.pub»

Найдите десять отличий…

Хотите получить помощь? Потрудитесь представить запрошенную информацию в полном объёме.

Прежде чем [Отправить], нажми [Просмотр] и прочти собственное сообщение. Сам-то понял, что написал?…


Оффлайн
Vail

Вместо этого:
rsync -r -v 192.168.0.101:/media/Maindata/Книги /media/Maindata/Книги/

Попробуйте это:
rsync -r -v rsync://192.168.0.101/media/Maindata/Книги /media/Maindata/Книги/


Оффлайн
Luca Brasi

Найдите десять отличий…

Нижеупомянутый вариант который не работает. Хотя по идее мог бы и работать, вот я и бросаюсь в крайности с принудительным упоминанием ключей через опцию -i

rsync -rv -e ssh --update andrew@192.168.0.101:/media/Maindata/Книги /media/Maindata/Книги

Вместо этого:
rsync -r -v 192.168.0.101:/media/Maindata/Книги /media/Maindata/Книги/
Попробуйте это:
rsync -r -v rsync://192.168.0.101/media/Maindata/Книги /media/Maindata/Книги/

Ну как-бы этот варинт ничего не меняет

Ubuntu 18.04/ AMD Ryzen 5 2600 3.4GHz/ MSI B450-A Pro Max / Crucial DDR4-3000 16384MB / MSI PCI-Ex GeForce GT 710 2048 MB / Chieftec GPS-600


Оффлайн
Azure

В Линукс можно сделать ВСЁ что угодно, достаточно знать КАК !


Оффлайн
Vail

Цитата: Vail от Сегодня в 10:18:12
Вместо этого:
rsync -r -v 192.168.0.101:/media/Maindata/Книги /media/Maindata/Книги/
Попробуйте это:
rsync -r -v rsync://192.168.0.101/media/Maindata/Книги /media/Maindata/Книги/
Ну как-бы этот варинт ничего не меняет
Сообщить модератору  

Ну, как-бы очень даже меняет.

Вот вам выхлоп с моего rsync сервера:

test:~$ rsync -r -v rsync://10.8.0.1/UNITS/UNITS/UNIT00010/Music/ /home/User/Музыка/
receiving incremental file list
skipping non-regular file «GlobalMusic»

sent 20 bytes  received 64 bytes  168.00 bytes/sec
total size is 37  speedup is 0.44

test:~$ rsync -r -v 10.8.0.1:/UNITS/UNITS/UNIT00010/Music/ /home/User/Музыка/
ssh: connect to host 10.8.0.1 port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(235) [Receiver=3.1.2]

меня одного смущает двоеточие после IP адреса, без указания порта?

В первом случае ничего не скачалось из-за того, что в папке на сервере лежат только символьные ссылки.


Оффлайн
Luca Brasi

Azure, без -e пробовал. Результат тот же что и с -e, т.е. нужен ввод пароля. Попутно у меня появилась еще одна проблема.
В какойто момент синхронизация начинает падать, т.к. есть файлы владелец которых рут. Следовательно доступ к ним я получить не могу… Есть способ игнорировать ошибки «permission denied»?

Ubuntu 18.04/ AMD Ryzen 5 2600 3.4GHz/ MSI B450-A Pro Max / Crucial DDR4-3000 16384MB / MSI PCI-Ex GeForce GT 710 2048 MB / Chieftec GPS-600


Оффлайн
AnrDaemon

нужен ввод пароля

Если просто ssh user@host пароля не требует, а rsync внезапно требует, значит, вы что-то не так делаете.

Попробуйте это:rsync -r -v rsync://

Не надо это пробовать.

Хотите получить помощь? Потрудитесь представить запрошенную информацию в полном объёме.

Прежде чем [Отправить], нажми [Просмотр] и прочти собственное сообщение. Сам-то понял, что написал?…


Оффлайн
Luca Brasi

Подитожу свои текущие сложности:

1. Убрать пароль и оставить одну лишь авторизацию по ключам (за это я с Вашей помощью сражаюсь уже не первый раз, и буду дальше сражаться :))
2. Можно обоходить стороной файлы владельцем которых является на $USER?
3. Когода начинается синхронизация у меня на клиенте остаются файлы которых на сервере уже нет. Хотелось бы от них и на клиенте избавлятся. Игрался с опциями —update, —delete, что не очень то и помогло.

Ubuntu 18.04/ AMD Ryzen 5 2600 3.4GHz/ MSI B450-A Pro Max / Crucial DDR4-3000 16384MB / MSI PCI-Ex GeForce GT 710 2048 MB / Chieftec GPS-600


  • Печать

Страницы: [1] 2  Все   Вверх

Понравилась статья? Поделить с друзьями:
  • Rsync chdir failed error
  • Rsync error some files attrs were not transferred see previous errors code 23
  • Rsi launcher installer error
  • Rsg ms verify gta 5 как исправить
  • Rsync error sending incremental file list