Springe zum Hauptinhalt

rsync "protocol incompatibility" caused by --dry-run

I just spend ap­prox. one hour to track down a nas­ty pro­blem, cau­sed by using ssh with au­t­ho­ri­zed keys and forced com­man­d. This is for the re­cords and ho­pe­ful­ly will help others to sol­ve the pro­blem qui­cke­r.

When try­ing to mo­ve a wor­king script to a dif­fe­rent ma­chi­ne and a dif­fe­rent user­-­ac­count, my rsyn­c­-­s­cript fai­led with this mes­sa­ge:

rsync error: protocol incompatibility (code 2) at io.c(1332) [sender=3.0.8]
rsync: connection unexpectedly closed (2668 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [receiver=3.0.7]
rsync: connection unexpectedly closed (70 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [generator=3.0.7]

Now in this spe­ci­al con­stel­la­ti­o­n, the­re are ma­ny pos­si­ble re­a­sons, sin­ce the ma­chi­nes are qui­te dif­fe­rent:

Ser­ver: Fe­do­ra 13, x86_64, opens­sh 5.4p1, rsyn­c  ver­si­on 3.0.8  pro­to­col ver­si­on 30

Old cli­ent: Ma­geia 1, i686, opens­sh 5.8p1, rsyn­c  ver­si­on 3.0.8 pro­to­col ver­si­on 30

New Cli­ent: De­bi­an Squee­ze, arm­v5tel, opens­sh 5.5p1, rsyn­c  ver­si­on 3.0.7  pro­to­col ver­si­on 30

To ma­ke a long sto­ry shor­t: The er­ror mes­sage is ab­so­lu­te­ly mis­lea­ding. The er­ror is not cau­sed by a pro­to­col in­com­pa­ti­bi­li­ty, but sim­p­ly by my forced com­man­d. And the er­ror is sim­p­ly trig­ge­red by using --­dry­-­run.

Explanation

When run­ning rsync with --­dry­-­run, ob­vious­ly the com­man­d, which is send to the ser­ver, dif­fer­s. Now the SS­H­-­Ser­ver drops the connec­ti­o­n, sin­ce the re­cei­ved com­mand does not match the forced com­man­d. rsync get com­mu­ni­ca­ti­on er­rors which it is mi­sin­ter­pre­ting and tal­king about "pro­to­col in­com­pa­ti­bi­li­ty­".

Portrait von Hartmut Goebel

Hartmut Goebel

Diplom-Informatiker, CISSP, CSSLP, ISO 27001 Lead Implementer

Haben Sie noch Fragen?
Anruf oder Mail genügt:
  +49 871 6606-318
  +49 175 29 78 072
  h.goebel@goebel-consult.de