Rsync error in rsync protocol data stream code 12 at io c

I'm trying to rsync data from one ubuntu box to another, but whenever I try to run the command, I get the error, error in rsync protocol data stream (code 12) at io.c(605) [Receiver=3.0.9] I've s...

I’m trying to rsync data from one ubuntu box to another, but whenever I try to run the command, I get the error,

error in rsync protocol data stream (code 12) at io.c(605) [Receiver=3.0.9]

I’ve seen people get io.c(600) and 610 errors in various other places around the web, but nothing about a 605 error. What’s the cause of this issue? How can it be fixed?

The command i’m running is

/usr/bin/rsync -az -e /usr/bin/ssh user@remote:filename /path/to/local/filename

asked May 27, 2014 at 21:15

Jules's user avatar

1

Make sure rsync is installed on remote server also.

Same issue was occurred but disappear after installing rsync on remote server. Without rsync on Remote server how it will work?

answered May 3, 2017 at 18:31

Dewlance's user avatar

DewlanceDewlance

4214 silver badges7 bronze badges

2

According to this it’s an official bug. At the bottom of the page, one victim of the bug mentions he doesn’t get it when the file he’s trying to send is < 100 GB or when he uses the -W flag on the client (which indicates whole file copy, rather than rsync delta resolution; basically, turns rsync into little better than scp).

answered May 27, 2014 at 21:22

Parthian Shot's user avatar

Parthian ShotParthian Shot

1,3801 gold badge13 silver badges24 bronze badges

2

I found that this error occurred when the hard disk drive of the target machine was full.

I found this after trying the accepted answer and getting the same error, so it might help someone for whom the accepted answer does not work. Clearly this is quite a specific answer and very easy to diagnose, so I do not presume that this error message is directly connected to a lack of space on the target.

answered Jan 27, 2015 at 11:59

M1ke's user avatar

M1keM1ke

6,0984 gold badges32 silver badges50 bronze badges

2

I’m going for the stupid award here…

$ rsync -axv /source/path john@remotehost:/path/does/not/exist
john@192.168.1.10’s password:
building file list … done rsync: connection
unexpectedly closed (8 bytes received so far) [sender]
rsync error:
error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-52.200.1/rsync/io.c(453)
[sender=2.6.9]

The error was on my side. The remote path didn’t exist. It took me a while to figure that out. I wonder why rsync can’t report something like that.

answered Apr 2, 2020 at 13:54

SPRBRN's user avatar

SPRBRNSPRBRN

2,3684 gold badges34 silver badges48 bronze badges

2

I got this error in rsync protocol data stream (code 12) for a pair of rsync’s with different versions. So please check the rsync versions on both client and server.

In my case, local rsync was version 2.6.9 (on Mac OSX), while remote one was version 3 (can’t remember now the exact version). Then I upgraded my local rsync to version 3 and that fixed the problem.

answered Apr 2, 2020 at 22:04

Gui Lima's user avatar

Gui LimaGui Lima

1661 silver badge9 bronze badges

In my experience this error occurs because the local host does not yet have the remote host’s key stored and ssh is rejecting the connection in background.

su - localUser -c "/usr/bin/rsync -avzh -e "/bin/sshpass -p ${password} 
ssh -oPort=remotePort -l remoteUser"  
remoteServer:/remoteFolder /localFolder"

In the explained scenario, the above command fails with the error:

error in rsync protocol data stream (code 12) at io.c(605) [Receiver=3.0.9]

without prompting to accept the remote key.

To resolve the problem simply connect to the remote host manually via ssh as localUser, and when asked «Do you want to accept remote host key yes/no» select «yes».

Thereafter, running the full command above should work fine.

NOTE: if you are connecting to the remote using @[servername] and @[servername].[domainname] then the remote host key needs to be configured for both variants as explained above.

answered Jun 6, 2016 at 16:42

Pancho's user avatar

PanchoPancho

1,87324 silver badges37 bronze badges

1

I had the same error (on Debian Wheezy) along with a kernel oops. The -W flag suggested in the bug report mentioned in Parthian Shot’s answer did not help. Also it wasn’t SSH-related since the rsync was done locally.

The issue was due to errors on the filesystem. Correcting them with fsck solved the problem. (Be sure to check there are not remaining rsync processes.)

answered Feb 11, 2015 at 18:34

Skippy le Grand Gourou's user avatar

This error occurred when uploading/updating files from a RHEL system (client) to a FreeBSD system (server).
rsync did give a message about libiconv.so.3 that was required but not available.
libiconv.so.3 was not on RHEL (client).
rsync on RHEL (client) started and worked fine.
Turned out the rsync install on FreeBSD (server) was broken. libiconv.so.3 was missing. As of that rsync on the FreeBSD system (server) was not able to start and causing the mentioned problem on the RHEL system (client).
Reinstalling rsync on FreeBSD (server) solved the problem.

answered Sep 14, 2017 at 12:50

digitaldaemon's user avatar

2

I will never ever ever understand!

I had this error:

rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(235) [Receiver=3.1.3]

For this command to backup files from a server to a local machine (files deleted on the server will be deleted on the local machine):

rsync --update -vr --delete -e ssh --rsh='sshpass -p MYPASSWORD ssh -l www-prod -p 42' mydomain.com:/mnt/images/ /media/usb-Samsung/backup_prod/images_rsync >> /media/usb-Samsung/backup_prod/images_rsync_result.txt

I was trying to execute it as root on the local machine and was getting only the error mentioned above.

And by chance I tried from a «normal» user and it worked!

I will never understand why executed as root on the local machine it was not working whereas it’s working executed as a simple user.

Dharman's user avatar

Dharman

29.3k21 gold badges80 silver badges131 bronze badges

answered Feb 17, 2021 at 13:37

London Smith's user avatar

London SmithLondon Smith

1,5902 gold badges15 silver badges37 bronze badges

This seems to be a bit of a catch-all error as I got the same error trying to transfer a huge number of little files from one VM to another (300K+ files). The issue in my case was that of too little RAM available on the target VM. Bumped it from 2G to 8G and it is copying away happily.

Just wanted to add this in case someone else is facing the same issue.

answered 2 days ago

Eldon McGuinness's user avatar

Permission denied, please try again. rsync: connection unexpectedly
closed (0 bytes received so far) [sender] rsync error: error in rsync
protocol data stream (code 12) at io.c(235) [sender=3.1.2]

I had this error wit rsync from my ubuntu to Synology DS411j

  • protocol version was different but that was not problem
  • ssh was working

I fixed problem on Synology system (armv5tel) to allow user use rsync

Now it is working perfect!

answered Jun 10, 2022 at 13:02

user2308728's user avatar

I’m trying to rsync data from one ubuntu box to another, but whenever I try to run the command, I get the error,

error in rsync protocol data stream (code 12) at io.c(605) [Receiver=3.0.9]

I’ve seen people get io.c(600) and 610 errors in various other places around the web, but nothing about a 605 error. What’s the cause of this issue? How can it be fixed?

The command i’m running is

/usr/bin/rsync -az -e /usr/bin/ssh user@remote:filename /path/to/local/filename

asked May 27, 2014 at 21:15

Jules's user avatar

1

Make sure rsync is installed on remote server also.

Same issue was occurred but disappear after installing rsync on remote server. Without rsync on Remote server how it will work?

answered May 3, 2017 at 18:31

Dewlance's user avatar

DewlanceDewlance

4214 silver badges7 bronze badges

2

According to this it’s an official bug. At the bottom of the page, one victim of the bug mentions he doesn’t get it when the file he’s trying to send is < 100 GB or when he uses the -W flag on the client (which indicates whole file copy, rather than rsync delta resolution; basically, turns rsync into little better than scp).

answered May 27, 2014 at 21:22

Parthian Shot's user avatar

Parthian ShotParthian Shot

1,3801 gold badge13 silver badges24 bronze badges

2

I found that this error occurred when the hard disk drive of the target machine was full.

I found this after trying the accepted answer and getting the same error, so it might help someone for whom the accepted answer does not work. Clearly this is quite a specific answer and very easy to diagnose, so I do not presume that this error message is directly connected to a lack of space on the target.

answered Jan 27, 2015 at 11:59

M1ke's user avatar

M1keM1ke

6,0984 gold badges32 silver badges50 bronze badges

2

I’m going for the stupid award here…

$ rsync -axv /source/path john@remotehost:/path/does/not/exist
john@192.168.1.10’s password:
building file list … done rsync: connection
unexpectedly closed (8 bytes received so far) [sender]
rsync error:
error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-52.200.1/rsync/io.c(453)
[sender=2.6.9]

The error was on my side. The remote path didn’t exist. It took me a while to figure that out. I wonder why rsync can’t report something like that.

answered Apr 2, 2020 at 13:54

SPRBRN's user avatar

SPRBRNSPRBRN

2,3684 gold badges34 silver badges48 bronze badges

2

I got this error in rsync protocol data stream (code 12) for a pair of rsync’s with different versions. So please check the rsync versions on both client and server.

In my case, local rsync was version 2.6.9 (on Mac OSX), while remote one was version 3 (can’t remember now the exact version). Then I upgraded my local rsync to version 3 and that fixed the problem.

answered Apr 2, 2020 at 22:04

Gui Lima's user avatar

Gui LimaGui Lima

1661 silver badge9 bronze badges

In my experience this error occurs because the local host does not yet have the remote host’s key stored and ssh is rejecting the connection in background.

su - localUser -c "/usr/bin/rsync -avzh -e "/bin/sshpass -p ${password} 
ssh -oPort=remotePort -l remoteUser"  
remoteServer:/remoteFolder /localFolder"

In the explained scenario, the above command fails with the error:

error in rsync protocol data stream (code 12) at io.c(605) [Receiver=3.0.9]

without prompting to accept the remote key.

To resolve the problem simply connect to the remote host manually via ssh as localUser, and when asked «Do you want to accept remote host key yes/no» select «yes».

Thereafter, running the full command above should work fine.

NOTE: if you are connecting to the remote using @[servername] and @[servername].[domainname] then the remote host key needs to be configured for both variants as explained above.

answered Jun 6, 2016 at 16:42

Pancho's user avatar

PanchoPancho

1,87324 silver badges37 bronze badges

1

I had the same error (on Debian Wheezy) along with a kernel oops. The -W flag suggested in the bug report mentioned in Parthian Shot’s answer did not help. Also it wasn’t SSH-related since the rsync was done locally.

The issue was due to errors on the filesystem. Correcting them with fsck solved the problem. (Be sure to check there are not remaining rsync processes.)

answered Feb 11, 2015 at 18:34

Skippy le Grand Gourou's user avatar

This error occurred when uploading/updating files from a RHEL system (client) to a FreeBSD system (server).
rsync did give a message about libiconv.so.3 that was required but not available.
libiconv.so.3 was not on RHEL (client).
rsync on RHEL (client) started and worked fine.
Turned out the rsync install on FreeBSD (server) was broken. libiconv.so.3 was missing. As of that rsync on the FreeBSD system (server) was not able to start and causing the mentioned problem on the RHEL system (client).
Reinstalling rsync on FreeBSD (server) solved the problem.

answered Sep 14, 2017 at 12:50

digitaldaemon's user avatar

2

I will never ever ever understand!

I had this error:

rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(235) [Receiver=3.1.3]

For this command to backup files from a server to a local machine (files deleted on the server will be deleted on the local machine):

rsync --update -vr --delete -e ssh --rsh='sshpass -p MYPASSWORD ssh -l www-prod -p 42' mydomain.com:/mnt/images/ /media/usb-Samsung/backup_prod/images_rsync >> /media/usb-Samsung/backup_prod/images_rsync_result.txt

I was trying to execute it as root on the local machine and was getting only the error mentioned above.

And by chance I tried from a «normal» user and it worked!

I will never understand why executed as root on the local machine it was not working whereas it’s working executed as a simple user.

Dharman's user avatar

Dharman

29.3k21 gold badges80 silver badges131 bronze badges

answered Feb 17, 2021 at 13:37

London Smith's user avatar

London SmithLondon Smith

1,5902 gold badges15 silver badges37 bronze badges

This seems to be a bit of a catch-all error as I got the same error trying to transfer a huge number of little files from one VM to another (300K+ files). The issue in my case was that of too little RAM available on the target VM. Bumped it from 2G to 8G and it is copying away happily.

Just wanted to add this in case someone else is facing the same issue.

answered 2 days ago

Eldon McGuinness's user avatar

Permission denied, please try again. rsync: connection unexpectedly
closed (0 bytes received so far) [sender] rsync error: error in rsync
protocol data stream (code 12) at io.c(235) [sender=3.1.2]

I had this error wit rsync from my ubuntu to Synology DS411j

  • protocol version was different but that was not problem
  • ssh was working

I fixed problem on Synology system (armv5tel) to allow user use rsync

Now it is working perfect!

answered Jun 10, 2022 at 13:02

user2308728's user avatar

I tried:

rsync -v -v -e 'ssh -p YY' ./testfile me@XXXXX:/home

Error Message

opening connection using: ssh -p YY -l me 146.6.84.206 rsync ->-server -vvve.s . /home 
[sender] make_file(testfile,*,0)
send_file_list done
send_files starting
server_recv(2) starting pid=17537
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600)[sender=3.0.6]
_exit_cleanup(code=12, file=io.c, line=600): about to call exit(12)

This works fine:

ssh -p YY me@XXXXX

Which suggests to me the problem is neither that sshd is not running nor that port YY is firewalled. I have checked anyway.

What other problems could there be?

EDIT:
The problem seems to have been «self resolving.» I could not replicate the following day. I started my local computer up. Perhaps notably I had a different IP address than last time. And now rsync magically works. I’d appreciate guesses as to what it could have been in light of it going away.

asked May 18, 2015 at 3:39

user3391229's user avatar

user3391229user3391229

1,1652 gold badges7 silver badges7 bronze badges

6

You can also get this error if you specify a remote path that doesn’t exist.

I got this error on OS X:

$ rsync -avz public/ static:apps/myapp.com
building file list ... done
rsync: connection unexpectedly closed (8 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) [sender=2.6.9]

Turned it was simply a matter of mistyping the destination path. The apps dir didn’t exist. When I changed that to static:sites/myapp.com instead (the sites dir did exist), the error went away.

It’s fine if the final directory in the path doesn’t exist (I could do static:sites/mynewapp.com) but it appears any preceding directory must already exist.

answered Jan 4, 2016 at 19:39

Henrik N's user avatar

Henrik NHenrik N

1,4861 gold badge10 silver badges7 bronze badges

8

I got this error when rsync wasn’t installed on the target host. The error message in my case also said rsync: command not found. A simple

sudo apt-get install rsync

on the target host solved the problem.

answered May 17, 2017 at 14:24

Florian Brucker's user avatar

3

Does your login script at the remote end produce garbage on stdout?
Check this with

ssh -p YY me@XXXXX /bin/true > out.txt

If out.txt contains data, identify the offending statements in your .profile or .bashrc and wrap them in

if [ ! -t 1 ]; then
  echo garbage
fi

answered May 18, 2015 at 8:35

Arjen's user avatar

ArjenArjen

3663 silver badges5 bronze badges

2

This error can also happen if the path to rsync at the remote system is not what the local system assumes it to be. You can see what is happening by specifying -vv (or even more vs). If this is the problem you can specify the remote path to rsync with the —rsync-path option.

answered Oct 18, 2016 at 17:21

Mike's user avatar

3

You may need to put in the full path to the ssh binary, ie

rsync -v -v -e '/usr/bin/ssh -p YY' ./testfile me@XXXXX:/home

Though there are other possible causes.

answered May 18, 2015 at 3:54

thomasrutter's user avatar

thomasrutterthomasrutter

35.4k10 gold badges85 silver badges103 bronze badges

1

I hit this error because I was rsyncing to a drive that was full! Check your disk usage if the other solutions here don’t help you resolve this.

answered Dec 15, 2020 at 21:09

duhaime's user avatar

duhaimeduhaime

5981 gold badge6 silver badges12 bronze badges

I happened to run into this error for a specific file’s transfer because a previously aborted rsync run seems to have corrupted the destination file (maybe due to interrupted delta/incremental changes on the destination file).

My solution was to find out which file caused the error (by using -v and/or --progress), deleting that file in the destination, then running rsync normally again.

answered Feb 28, 2022 at 12:52

Abdull's user avatar

AbdullAbdull

2992 gold badges6 silver badges12 bronze badges

I was seeing this error:

rsync -e 'ssh -v'

debug1: Exit status 11

rsync error: error in rsync protocol data stream (code 12) at /BuildRoot
/Library/Caches/com.apple.xbs/Sources/rsync/rsync-51/rsync/io.c(453)
[sender=2.6.9]

I was able to ssh into the remote host and found that it was out of disk space.

Ravexina's user avatar

Ravexina

53k23 gold badges151 silver badges176 bronze badges

answered May 2, 2017 at 20:37

Andy's user avatar

AndyAndy

1012 bronze badges

I got this error in rsync protocol data stream (code 12) for a pair of rsync’s with different versions. So please check the rsync versions on both client and server.

In my case, local rsync was version 2.6.9 (on Mac OSX), while remote one was version 3 (can’t remember now the exact version). Once I upgraded my local rsync to version 3 (using brew), the problem was fixed.

answered Apr 2, 2020 at 22:09

Gui Lima's user avatar

Recently I have been unable to rsync over ssh. Each time I get the same error

bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]

I am running

sudo rsync -av /var/www/html/somedir/ myuser@999.999.99.9:Users/myuser/Desktop/ec2backup

Please note the username, IP, and directories have been changed for the purposes of this post.

In the past I have ran the exact same command as verified using bash_history.

What I have tried:

  1. Ran a similar command from another server, resulting in the same
    error message.
  2. Tested rsync locally (local dir to local dir), which worked
    perfectly.

The only thing that has changed is I’ve recently installed Virtualbox and Vagrant. Is it possible I may have messed up authentication/ports/etc on my local machine?

Any help is greatly appreciated.

asked Aug 28, 2018 at 23:52

TucDev990's user avatar

1

rsync is not installed on 999.999.99.9

answered Aug 29, 2018 at 0:03

Sandor Marton's user avatar

6

my problem was that I was using cwrsync_6.2.1_x64 in conjunction with SSH_for_Windows_7.7p1, LibreSSL 2.6.5 that was preinstalled in win10 2004 build 19041.685.

in your rsync command, you need to point to the ssh.exe that comes with that specific rsync build. For example:

rsync -avHz -e "path_tocwrsync_6.2.1_x64_freebinssh.exe" --partial ...

Andrew Schulman's user avatar

answered Feb 17, 2021 at 10:44

Remuz's user avatar

RemuzRemuz

811 silver badge1 bronze badge

1

I got this error error when the target directory didn’t pre-exist. With a source data file: /a/b/c/d/data,
rsync -av -e ssh /a/b/c/d/ hostname:/a/b/c/d
needs the target directory: hostname:/a/b/c to pre-exist.

In reading the man page as a last resort I see that this is the intended behavior.

answered Nov 11, 2020 at 18:36

Don's user avatar

Using cygwin, I did a ‘which rynsc’ and the result was the rsync provided by the cygwin setup program. I had previously installed rsync through Cygwin setup. However, when I did, from Cygwin, ‘which ssh’, it was pointing to the ssh of the Windows path. So, I exited Cygwin, executed the cygwin setup program and installed ssh from cygwin. After I did that, I did the same two previous commands again (which rsync and which ssh) and both binaries were pointing to the cygwin binaries. Then when I did my rsync from cygwin, it worked without any issue at all.

answered Jun 24, 2021 at 19:31

Daniel Reimann's user avatar

Lack of permissions to access the remote directory caused the same error.

on the server

~# sudo -u ubuntu ls -l /opt/aws/opsworks/current/
   ls: cannot access /opt/aws/opsworks/current/: Permission denied

on the client

$ rsync --dry-run -v -r --checksum ./ ubuntu@10.1.1.1:/opt/aws/opsworks/current/
...
rsync: connection unexpectedly closed (8 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-52.200.2/rsync/io.c(453) [sender=2.6.9]

answered May 14, 2022 at 7:37

David Davidov's user avatar

With the exception of the rsync: command not found you might get 12 Error in rsync protocol data stream if the remote (ssh) user requests a password change.
I.e on an expired password — even if you use ssh keys.

Got that exact error message in a backup script, and when manually logging in to the remote server — from the backup server — I got this:

WARNING: Your password has expired.
You must change your password now and login again!
Changing password for user logs.
Changing password for logs.
(current) UNIX password:

Either set the new password, or remove password expiry rules. ymmv — and check with your admin if your not it.

On the remote server:

chage -l logs ; chage -I -1 -m 0 -M -1 -E -1 logs ; chage -l logs

answered Jan 29, 2020 at 9:28

sastorsl's user avatar

sastorslsastorsl

3622 silver badges14 bronze badges

I got this error in rsync protocol data stream (code 12) for a pair of rsync’s with different versions.

In my case, local rsync was version 2.6.9 (on Mac OSX), while remote one was version 3 (can’t remember now the exact version).

Then I upgraded my local rsync to version 3 (using brew) and that fixed the problem.

answered Apr 2, 2020 at 21:59

Gui Lima's user avatar

1

When I get this error, it is usually because the path on the remote server is invalid or does not exist. mkdir -p fixes it up.

Michael Hampton's user avatar

answered Jul 13, 2021 at 3:41

tqwhite's user avatar

Rsync must be installed in both servers, origin and destine.

answered Apr 7, 2022 at 3:01

Andres Mejia's user avatar

0

Permission denied, please try again. rsync: connection unexpectedly
closed (0 bytes received so far) [sender] rsync error: error in rsync
protocol data stream (code 12) at io.c(235) [sender=3.1.2]

I had this error wit rsync from my ubuntu to Synology DS411j

  • protocol version was different but that was not problem
  • ssh was working

I fixed problem on Synology system (armv5tel) to allow user use rsync

Now it is working perfect!

answered Jun 10, 2022 at 13:06

user2308728's user avatar

I was getting a similar error on macOS when trying to rsync from macOS to Ubuntu. Both had the same version of rsync, but it turned out ssh server was not installed on Ubuntu. To install it:

sudo apt install openssh-server

answered Apr 27, 2021 at 14:43

lenooh's user avatar

2

Содержание

  1. Rsync error code 12 – How we figure it out?
  2. Explaining Rsync error code 12
  3. Causes and fixes for the Rsync error 12
  4. 1. Insufficient disk space
  5. 2. Missing remote Rsync
  6. 3. Failure due to idle connection
  7. Conclusion
  8. PREVENT YOUR SERVER FROM CRASHING!
  9. Нетипичная причина ошибки code 12 при отправке файлов на VPS через rsync
  10. Задача
  11. Код Gulp таска (TypeScript)
  12. Ошибка
  13. Отсечение типичных причин
  14. Указан неверный адрес соединения
  15. На VPS не установлен rsync
  16. Недостаточно памяти
  17. Отсутствуют права доступа
  18. Блокирование запроса файрволлом
  19. Более подробный вывод rsync в опциями
  20. Вывод команды «sudo ifconfig -a» на VPS
  21. Информация о локально установленном RSync
  22. rsync closing connection with code 12 error
  23. drobison
  24. richardtoohey2
  25. drobison
  26. Can’t get rsync working (error in rsync protocol data stream (code 12) at io.c(605))
  27. Linux Mint Forums
  28. rsync — error when trying to copy over local network
  29. rsync — error when trying to copy over local network
  30. Re: rsync — error when trying to copy over local network
  31. Re: rsync — error when trying to copy over local network
  32. Re: rsync — error when trying to copy over local network
  33. Re: rsync — error when trying to copy over local network
  34. Re: rsync — error when trying to copy over local network
  35. Re: rsync — error when trying to copy over local network
  36. Re: rsync — error when trying to copy over local network
  37. Maybe computer 1 is not the root cause after all
  38. Re: rsync — error when trying to copy over local network
  39. Must there be a network share for using rsync
  40. Re: rsync — error when trying to copy over local network
  41. Re: rsync — error when trying to copy over local network
  42. Re: rsync — error when trying to copy over local network
  43. sudo apt-get install ssh

Rsync error code 12 – How we figure it out?

by Keerthi PS | Oct 7, 2019

Backups and file transferring is important for server management.

And Rsync is one of the best shots, but errors are always a setback.

Rsync error code 12 is a tricky error that occurs due to insufficient disk space, network errors and so on.

That is why at Bobcares, we often get requests to fix Rsync errors as a part of our Server Management Services.

Today, let’s see how our Support Engineers fix Rsync error code 12 for our customers.

Explaining Rsync error code 12

Rsync is one of the popular file synchronization tools. It is useful for both local and remote file transfer.

If the destination already contains the source file then the Rsync only copies the differences. This makes Rsync a faster file transfer option.

But, in many situations, the Rsync operation ends by showing the error message:

So, why does the file transfer ends by showing an error code 12?

Usually, the reason for this varies from insufficient disk space to network errors, improper destination and so on.

Let’s now check on a few reasons and see how our Support Engineers fix them.

Causes and fixes for the Rsync error 12

Whenever a server operation ends up in error, the initial troubleshooting starts from the log file. In the case of Rsync, our Support Engineers always make sure to set up the log file right. As a result, the reason that leads to the error can be easily found out from teh log file.

The most common reasons for the Rsync error code 12 are:

1. Insufficient disk space

While trying to Rsync data from one server to another, one of our customers got the error code 12. Here, the user tried to transfer a large file.

So, our Support Engineers initially tried to transfer a small file. Since the file transfer was successful, we could infer that the disk space was insufficient in the first case.

Thus, we always recommend checking the disk space before transferring large files. For instance, the free disk space should be at least more than the size of the largest file.

2. Missing remote Rsync

In some cases, the remote side does not have Rsync installed. Also, the destination path specified does not exist. In both cases, the Rsync error 12 shows up.

For instance, one of our customers executed the command:

Here, YY denotes the SSH port number.

This ended up in the error code 12.

Initially, our Dedicated Engineers made sure that ssh -p YY user@XXXXX works fine. Since this was working fine, we checked the Rsync in the remote end.

Rsync was found missing in the remote end. So, we installed it on the Ubuntu/Debian server using:

That fixed the error and Rsync ran successfully.

3. Failure due to idle connection

Similarly, an idle connection can also show the error code 12 in remote file transfer.

In such situations, our Support Team always recommends using –timeout option in the Rsync command. Here, the Rsync sends keep-alive messages to the remote server to prevent a timeout.

We can also configure ssh to prevent timeout by setting a few parameters like KeepAlive, ServerAliveInterval, ServerAliveCountMax, etc.

[Having trouble in fixing Rsync errors? – We’ll help you.]

Conclusion

In short, Rsync error code 12 denotes ‘error in rsync protocol data stream’. Usually, this error occurs due to insufficient disk space, missing Rsync at the destination, idle connection timeout and so on. Today, we saw how our Support Engineers fix this error for our customers.

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.

Источник

Нетипичная причина ошибки code 12 при отправке файлов на VPS через rsync

Задача

Обеспечить загрузку на VPS собираемого локально Docker-образа с помощью gulp-rsync.

Код Gulp таска (TypeScript)

Поскольку на приобретённом VPS недостаточно памяти для Docker-образа, то я решил начать с загрузки одного js-файла. Полагаю, если он будет загружаться нормально, то при наличии достаточной памяти и Docker-образ загрузится без проблем.

Имя папки с проектом я спрятал под myproject.com , но так как текущий VPS приобретён для учебных целей, то IP-адрес прятать не буду.

Ошибка

После выполнения приведённого выше gulp-таска будет запрошен пароль для учётной записи non_root_admin. После его ввода возникнет ошибка:

Тут сразу возникает вопрос: какова рациональная причина, по которой создатели rsync дают такое «понятное и подробное» объяснение причины ошибки? Если поискать значение code 12, то там будет целая группа разнородных причин. Что же, в рамках долга собственных усилий я обязан отсечь типичные причины.

Отсечение типичных причин

Указан неверный адрес соединения

При вводе правильного пароля для учётной записи «non_root_admin» (как и положено, я создал эту учётную запись с пониженными привилегиями для повседневного пользователя),

ошибка будет такая:

Теперь попробую намеренно ввести неправильный пароль. Ошибка станет другой:

Таким образом, как минимум до успешной аутентификации всё идёт хорошо.

Напоследок, выполню обычный вход через SSH:

На VPS не установлен rsync

На VPS у меня новейшая на момент задавания вопроса Ubuntu 20.04. Проверяю версию предустановленной утилиты rsync:

Недостаточно памяти

Поначалу оно так и было: для тренировки я купил VPS на 512 мегабайт, но как-то не учёл, Hello-world-приложение на NodeJS порядка 90 килобайт будет весить в Docker-образе около 900 мегабайт. Но потом, как я уже говорил, в рамках этого упражнения я ограничился точкой входа для серверной части BackEndEntryPoint.js .

На данный момент мало что понимаю в табличных данных команды df -h , но этот скриншот послужит доказательством, что по крайней мере на загрузку 90-килобайтового файла памяти должно хватить:

Отсутствуют права доступа

Согласно тому, что мне уже подсказали, на VPS должна быть целевая директория «/var/www/myproject.com». Сам я об этом не догадался, ибо думал, что rsync, будучи программой, работающей с копированием файлов и папок сама все создаст.

В общем, я эту директорию создал, причём, чтобы отсечь причину неверных прав — с правами 777. В будущем в целях безопасности нужно будет пересоздать эту директорию с меньшими правами (755?).

Вывожу список директорий через ls -al . Созданную директорию подчеркнул красным:

Даже при таких высоких правах ошибка code 12 всё равно не исчезает.

Блокирование запроса файрволлом

Что интересно, файрволл подозревают редко (не видел его в перечислениях частых причин). А ведь изначальные настройки файрволла в Ubuntu 20.04-

Вроде как это не означает, что соединение по rsync разрешено. На это же косвенно и указывает эта статья, где написано, как это соединение разрешить для конкретного IP-адреса.

Теперь статус файрволла имеет вид

К сожалению, и это не изменило ситуацию.

Более подробный вывод rsync в опциями

Если в рамках эксперимента просто попытаться отправить файл через rsync, то в выводе не будет ничего нового:

Когда меня попросили выполнить ту же команду с опцией -vvv , то вывод был такой (впрочем, то же не отличающийся информативностью):

Вывод команды «sudo ifconfig -a» на VPS

Информация о локально установленном RSync

Честно говоря, не помню как поставил его на свой Windows 10, но скорее всего через Chocolatey. Вывод rsync -V такой:

Источник

rsync closing connection with code 12 error

drobison

Just replaced a server today and was doing some routine rsync transfers. Been doing this for years.

Now a repeatable error has presented itself:

Server #1 is using the bge driver, server #2 is using the ixl driver, but it is throttled to 1gb since that’s all our cisco will handle.

I’ve had this error pulling to server #1 from server #2:

and pushing from server #2 to server #1 I’ve gotten this error:

I am running ipfw so I put in a rule #1 which just says allow all traffic to and from these two servers. Crash still occurs.

I’ve never seen this before. Hoping someone recognizes this and has some suggestions.

richardtoohey2

Don’t think it’s the case here but the only time I had rsync issues was faulty RAM. The message I got was nothing to do with RAM (similar to the above — lost connections) it was just something I tried after banging my head on the walls thinking of (and eliminating) a million (well, it felt like it!) possible network issues.

So don’t think I’m being a great help other than don’t assume it’s rsync or a firewall or network error — it might be some other component issue (like RAM in my case.) Just what you need, more possibilities!

drobison

OK I figured it out. With the help of the brilliant Devin Teske.

This server runs a few standard jails and one vimage/netgraph jail. I never had any issue until I fired up the jails, at which point sup and rsync started having this error.

Источник

Can’t get rsync working (error in rsync protocol data stream (code 12) at io.c(605))

Hi there, i’ve got the follwing problem:

when I run rsync via WebGUI I get the following error:

Here is my configuration:

Via CLI «rsync -aP /xxxxx root@192.168.20.211:/xxxx» the rsync command runs without problems.
Any ideas?

the configuration again for better reading:

By using ‘:/’ your calling the rsync over ssh transport that’s not supported over the webui. The password requested there is for rsync modules not standard login. Omv3 has support for rsync over ssh.

Edited 2 times, last by subzero79 ( Aug 25th 2016 ).

I’m getting the same error:

Trying to test an rsync from our mac server to our new server before we switch over. Mac server is currently live and didn’t want to copy everything over out of work hours, before testing the switching, so thought rsync would be ideal. Get them both working and syncing.

Obviously pulling from the source server [mac], seems to be connecting, but then errors. Not sure if it’s the .local address that’s the issue, but I’ve had [No directory found] on other attempts using ip and rsync commands.

Newbie to rsync, so it might be a basic error. Any pointers?

Источник

Linux Mint Forums

Welcome to the Linux Mint forums!

rsync — error when trying to copy over local network

rsync — error when trying to copy over local network

Post by SprinterDriver » Sat Oct 07, 2017 2:55 pm

I have two Linux Mint computers at home.

Computer 1
Linux Mint 18.1 Mate 32-bit
Interface: 802.11 WiFi (wlp0s8)
IP: 192.168.0.16

Computer 2
Linux Mint 18.1 Xfce 32-bit
Interface: 802.11 WiFi (wlp1s5)
IP: 192.168.0.20

Currently I sit on Computer 2, have e directory at Computer 1 that I want to copy over the local network.

So therefore I trying to run the command and then I get an error:

Re: rsync — error when trying to copy over local network

Post by MintBean » Sat Oct 07, 2017 3:06 pm

Re: rsync — error when trying to copy over local network

Post by SprinterDriver » Sat Oct 07, 2017 3:22 pm

Both computers seem to run ssh-server (I tested according to this post)

Wonder if it may be a problem with the router:

[Edit / update]
Correction in post #1 — computer 2 is Mint 18.2 Xfce , not Mate.

Also, when I sit in front of Computer 1, I can ping computer 2 — but not the other way around.

[edit #2]
And all of a sudden I could ping computer 1:

hm, high percent of lost packages?

[edit #3]
Trying to run rsync once again to see what happens:

Re: rsync — error when trying to copy over local network

Post by MintBean » Sat Oct 07, 2017 3:46 pm

The desktop you’re running on the machines shouldn’t make any difference.

Try turning the firewall off in the Mint settings for both machines and see if the ping works. Don’t forget to turn it back on after.

Re: rsync — error when trying to copy over local network

Post by SprinterDriver » Sat Oct 07, 2017 4:10 pm

Disabled firewall on both computers.

Sitting on Computer 2 and ping against Computer 1, average rtt 852 ms.
Pinging the other way, average rtt 0.094 ms.
Pinging against 192.168.0.1 (router) gives average rtt about 8-10 ms on both computers.

Had to double check the numbers, there is a big difference in average rtt repported by ping command depending on what direction I ping.

rsync: Same command on Computer 2 terminal, and same error message as before.
I guess that firewall is not to blame.

Re: rsync — error when trying to copy over local network

Post by SprinterDriver » Sun Oct 22, 2017 8:10 pm

A little update. I now have added a third computer to my wifi network that runs Xubuntu (192.168.0.10). I’ll use that computer tomorrow to conduct what will hopefully be my first complete file transfer using rsync.

When that said — I have just conducted a ping between all the three computers on the WiFi network home. Ping between this computer (computer 2) and the Xubuntu laptop (computer 3) runs just fine both ways. But ping to and from computer 1 seems to go much slower, the packages seems to spend a lot more time — but this time my attempts to ping to and from computer 1 didn’t resulted in package loss — apparently.

Therefore I attempted to run the rsync command once again, but not success:

Re: rsync — error when trying to copy over local network

Post by catweazel » Mon Oct 23, 2017 1:10 am

Re: rsync — error when trying to copy over local network

Post by SprinterDriver » Mon Oct 23, 2017 5:43 pm

Maybe computer 1 is not the root cause after all

Post by SprinterDriver » Mon Oct 23, 2017 6:00 pm

I have similar problems running rsync when trying to copy files from computer 3 (Xubuntu) to computer 2 (LM Xfce) when sitting on computer 2:

Re: rsync — error when trying to copy over local network

Post by Minterator » Mon Oct 23, 2017 6:34 pm

This should be simple. Click on Network, mount the network share by log-in to other PC. Can you see the share files in File Manager?

If so, use simple path in command line, /run/user/1000/gvfs/smb-share:server.
per my posts here: viewtopic.php?f=208&t=234568

Post by SprinterDriver » Wed Oct 25, 2017 3:30 pm

Thanks for answering.

I see this link you posted will without doubt make me use time to install and set up the OS (or both?) in a way so that rsync may or may not work.

So before I start doing this change, I want to ask what to me seems like an important question — because I have read around the web and man page for how to use rsync, and I have not read anything about it require a samba share in order to work.

Because — what I was lead to believe when I read about rsync is literately «wow — here I got a tool that let my copy/sync files over network without the need of share folders». Is that assumption wrong?

Re: rsync — error when trying to copy over local network

Post by rene » Wed Oct 25, 2017 4:17 pm

Re: rsync — error when trying to copy over local network

Post by SprinterDriver » Wed Oct 25, 2017 6:52 pm

Ok — I still need to learn this

Had to find out what you meant by «log in to the remote through ssh» — so I searched the net and found the command to run. This is what I run from the Xubuntu machine:

Re: rsync — error when trying to copy over local network

Post by rene » Wed Oct 25, 2017 8:06 pm

That mentioned first reply specified such as well (with the slight difference that now that you didn’t explicitly provide a user@ part before the address or hostname, the username of the invoking user — sprinterdriver supposedly — was used automatically).

In any case: you have now shown rsync to not itself be the problem. Generally, you’d check

1. Network connectivity. I.e., ping remote for a suitable value of «remote»; a hostname or IP address.
2. ssh remote or ssh user@remote for «user» a username existing on «remote»; furthermore read «remote» as saying «remote» or «user@remote»
3. touch

/barfoo
4. repeat step 3 with scp replaced by rsync (but if 3 works there’s little opportunity for this rsync version to not work).

Clearly the remote will need to be running an ssh server. scp and rsync authenticate the same as ssh itself; normally through either password or public key.

Other than ssh other options for rsync are a dedicated rsync server running on the remote and network-mounting an export from the remote (of any type but usually CIFS or NFS) locally; as far as rsync itself is concerned you’d in the latter case use it «in local mode only»; as an extended cp command only. I’ll note that using rsync in that manner with an NFS mount is normally fastest.

But your issue seems not primarily related to rsync and you may as such wish to debug this further in a new thread in the networking section. Please note if applicable: running a firewall within a private LAN is a very silly thing to do unless you specifically know that it is not. Much more specific than «but will I not get virusmalwares otherwise. «

sudo apt-get install ssh

Post by SprinterDriver » Thu Oct 26, 2017 5:57 pm

Thanks again. So after some further reading, I found out something — but I’m not there yet.

Had a lot of problems regarding «connection refused port 22» — so I have tried to fix that.

First off — I found that the firewall on the Mint laptop was on — in default state that for me seems to reject all. Without no further investigation I just disabled Firewall (until it allow only port 22) on both computers.

Then I found from a couple of other forum, that other people before me had success with similar problem by sudo apt-get install ssh . So I did — on both computer 2 and computer 3.

Running the ssh command now gives:

What does this mean The authenticity of host ?

Anyway — after hitting Y and ‘yes’ — this is the full output:

$ ssh sprinterdriver@192.168.0.20
The authenticity of host ‘192.168.0.20 (192.168.0.20)’ can’t be established.
ECDSA key fingerprint is SHA256:e8FqD98wlyNCHbbeb81DuB4G0E2pdebJWfFJj/wLyL8.
Are you sure you want to continue connecting (yes/no)? Y
Please type ‘yes’ or ‘no’: yes
Warning: Permanently added ‘192.168.0.20’ (ECDSA) to the list of known hosts.
dispatch_protocol_error: type 7 seq 3
dispatch_protocol_error: Connection to 192.168.0.20 port 22: Broken pipe

Источник

Hello, I just updated from v3 and can’t backup anything due to this error.
I deleted the old v3 topdir and installed a new one so this should be a pure v4 installation (I’ve update config.pl too).
This is the xfer log (loglevel 7):

XferLOG file /var/lib/backuppc/pc/stefano/XferLOG.0.z created 2017-05-16 07:28:37 
Backup prep: type = full, case = 1, inPlace = 1, doDuplicate = 0, newBkupNum = 0, newBkupIdx = 0, lastBkupNum = , lastBkupIdx =  (FillCycle = 0, noFillCnt = )
Running: /usr/local/bin/rsync_bpc --bpc-top-dir /var/lib/backuppc --bpc-host-name stefano --bpc-share-name docs --bpc-bkup-num 0 --bpc-bkup-comp 3 --bpc-bkup-prevnum -1 --bpc-bkup-prevcomp -1 --bpc-bkup-inode0 1 --bpc-attrib-new --bpc-log-level 7 --super --recursive --protect-args --numeric-ids --perms --owner --group -D --times --links --hard-links --delete --delete-excluded --one-file-system --partial --log-format=log: %o %i %B %8U,%8G %9l %f%L --stats --checksum --iconv=utf8,cp1252 --timeout=72000 --password-file=/var/lib/backuppc/pc/stefano/.rsyncdpw29018 backuppc@192.168.0.1::docs /
full backup started for directory docs
Xfer PIDs are now 29033
This is the rsync child about to exec /usr/local/bin/rsync_bpc
bpc_path_create(/var/lib/backuppc/pc/stefano/0)
bpc_attrib_backwardCompat: WriteOldStyleAttribFile = 0, KeepOldAttribFiles = 0
rsync_bpc: read error: Connection reset by peer (104)
bpc_sysCall_cleanup: doneInit = 1
RefCnt Deltas for new backup
Uncompressed HT:
Compressed HT:
Done: 0 errors, 0 filesExist, 0 sizeExist, 0 sizeExistComp, 0 filesTotal, 0 sizeTotal, 0 filesNew, 0 sizeNew, 0 sizeNewComp, 1 inode
Parsing done: nFilesTotal = 0
rsync error: error in rsync protocol data stream (code 12) at io.c(788) [Receiver=3.0.9.6]
rsync_bpc exited with fatal status 12 (3072) (rsync error: error in rsync protocol data stream (code 12) at io.c(788) [Receiver=3.0.9.6])
Xfer PIDs are now 
Got fatal error during xfer (No files dumped for share docs)
Backup aborted (No files dumped for share docs)
BackupFailCleanup: nFilesTotal = 0, type = full, BackupCase = 1, inPlace = 1, lastBkupNum = 
Removing empty backup #0
Xfer PIDs are now 29038
BackupPC_backupDelete: removing #0
BackupPC_backupDelete: No prior backup for merge
Xfer PIDs are now 29039,29038
BackupPC_refCountUpdate: computing totals for host stefano
bpc_attrib_backwardCompat: WriteOldStyleAttribFile = 0, KeepOldAttribFiles = 0
BackupPC_refCountUpdate: host stefano got 0 errors (took 0 secs)
BackupPC_refCountUpdate total errors: 0
Xfer PIDs are now 29038
BackupPC_backupDelete: got 0 errors
Xfer PIDs are now 
Finished BackupPC_backupDelete, status = 0 (running time: 0 sec)
Xfer PIDs are now 
Running BackupPC_refCountUpdate -h stefano -f on stefano
Xfer PIDs are now 29040
BackupPC_refCountUpdate: computing totals for host stefano
bpc_attrib_backwardCompat: WriteOldStyleAttribFile = 0, KeepOldAttribFiles = 0
BackupPC_refCountUpdate: host stefano got 0 errors (took 0 secs)
BackupPC_refCountUpdate total errors: 0
Xfer PIDs are now 
Finished BackupPC_refCountUpdate (running time: 0 sec)
Xfer PIDs are now 

Any hint ? I have the same on all 3 clients (all running Windows 10 with rsyncd)
Thanks in advance

Понравилась статья? Поделить с друзьями:
  • 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