Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When doing an rsync pull from a remote server using the following command:

/usr/bin/rsync -av -e ssh --delete --chmod=a+rwx,g+rwx,o-wx --dry-run username@server:/remote/path/ /home/dir/local/path

I get the following error:

receiving file list ... Invalid flist flag: 1004
rsync error: protocol incompatibility (code 2) at flist.c(2354) [Receiver=3.0.7]

When doing the reverse (ie. PUSH) from remote to local, i get the following:

building file list ... Invalid flist flag: 1004
rsync error: protocol incompatibility (code 2) at flist.c(2354) [Receiver=3.0.7]
rsync: connection unexpectedly closed (8 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(468) [sender=2.6.8]

I've tried removing the parameters one by one and it seems to be related to the -a flag


# local machine
Linux lbox 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux
# rsync version
rsync  version 3.0.7  protocol version 30

# remote machine
FreeBSD rbox 6.4-STABLE FreeBSD 6.4-STABLE #0: Mon Feb 22 01:05:13 EST 2010     UNIX-BSD
rsync  version 2.6.8  protocol version 29

Can this be resolved easily?

share|improve this question
can be related :… – cstamas Oct 5 '12 at 7:03
I didn't get the 'is your shell clean' error. And as you can see the exceptions are thrown in different parts of the rsync source code. – denormalizer Oct 8 '12 at 0:24

The FreeBSD box has a six-year-old version of rsync which uses an older protocol version. You can force the new version of rsync to use the old protocol by adding --protocol=29 to your rsync command.

share|improve this answer
This seemed to be the logical answer. I tried (on both ends) and the same error :( – denormalizer Oct 5 '12 at 4:17
The next step, then, is to update the antique version of rsync. – Michael Hampton Oct 5 '12 at 4:26
Haha. I'll see if that's feasible. Thanks – denormalizer Oct 5 '12 at 4:28
I'm surprised rsync didn't fall back - it's usually good about that... – voretaq7 Oct 5 '12 at 14:06
@voretaq7 In fact, I think it did. But it still didn't help. As you can see from my comment, even when I forced the protocol it still complained. – denormalizer Oct 8 '12 at 0:09
up vote 3 down vote accepted

Interestingly, putting an intermediary machine between origin and destination machine achieves the desired result:


machine 1 (origin) >> machine 2 (intermediary) >> machine 3 (destination)

machine 1: rsync  version 2.6.8  protocol version 29
machine 2: rsync  version 3.0.3  protocol version 30
machine 3: rsync  version 3.0.7  protocol version 30
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.