How to solve Rsync sender write error broken pipe
How to solve Rsync sender write error broken pipe2 minutes 54s
A common error
There is a common error in Rsync, that happens seemingly out of nowhere, and is difficult to debug.
rsync: [sender] write error: Broken pipe (32) rsync error: error in rsync protocol data stream (code 12) at io.c(829) [sender=3.1.2]
Often the cause is different Rsync versions on client and server
Sometimes, after an update, or the provisioning of a new server, rsync will stop working.
The reason is conflicting protocol versions in rsync. We can first confirm that we are running different versions.
From the output of the previous command we see we are running version 3.1.2 on our client. We would do the same in the server.
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 rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the GNU General Public Licence for details.
A question of protocol
Once we have confirmed that the Rsync versions are different, we can try a simple solution.
We add --protocol=29 to our rsync command. Below you can see an example.
rsync --delete -rvz -P --partial --ignore-times --timeout=0 --protocol=29 /home/gsus/myfiles/ email@example.com:/home/gsus/myfiles
Passing the option to specify the protocol to run makes different versions of Rsyncplay nicely with each other.