Problem with rsync

I use rsync (http://rsync.samba.org/) already for long time to backup files locally and also to put files to the provider when I update my sites. Yet recently I have started getting periodically the error

rsync: writefd_unbuffered failed to write 4092 bytes to socket [sender]: Connection reset by peer (104)
ERROR: out of memory in flist_expand [generator]
rsync error: error allocating core memory buffers (code 22) at util.c(117) [generator=3.0.5]
rsync: connection unexpectedly closed (6027 bytes received so far) [sender]
rsync error: error allocating core memory buffers (code 22) at /home/lapo/package/rsync-3.0.8-1/src/rsync-3.0.8/io.c(601) [sender=3.0.8]

under Cygwin 1.7. Before under Cygwin 1.5 there was no problem.

On the rsync site, there are guidlines on how to debug this issue

http://rsync.samba.org/issues.html

but I have finally decided to compile an older version, as I have had never before problems with rsync.

To compile rsync (change x.x.x. by the version number)

wget http://rsync.samba.org/ftp/rsync/src/rsync-x.x.x.tar.gz
tar zxvf rsync-x.x.x.tar.gz
cd rsync-x.x.x
./configure
make

To install rsynce either use

make install

that will install by default in /usr/local/bin or just copy rsync manually. The standard rsync under cygwin is in /usr/bin, so the compiled version will not override the already existing one. At the same time by default /usr/local/bin stays before /usr/bin on the path, so the compiled version will be executed (you may need rehash). Use

which rsync
where rsync

to research on that. On the server I have copied the compiled rsync to ~/bin (it was actually first on my default path there) and it was enough. Alternatively one can modify the path by using .ssh/rc that is run for every ssh connection.

Compilation went okay. Well, when I have tried to compile version 2.0.0, then there was a conflict with strlcpy in rsync 2.0.0 and in string.h. I have used changeid to fix it:

changeid strlcpy strlcpy2 *.h *.c

and then it went okay. In version 2.5.0 there was a conflict with inet_ntop between rsync.h and inet.h but I have just commented the definition of inet_ntop in rsync.h out and it went okay then.

Version 2.0.0 was too old, it doues not supporte for example --progress and --modify-window. It also does not work with 3.*, the error being

rsync error: protocol incompatibility (code 2) at compat.c(174)

Finally I have found that with 2.5.0 on both sides everything functions, I do not get the error above anymore.


Comments are closed.