dsync error: Received unexpected input d != N

David Mandelberg david at mandelberg.org
Wed Nov 3 18:27:28 UTC 2021

Op 02-11-2021 om 22:43 schreef David Mandelberg:
> Hi,
> I'm trying to set up replication with dsync, and I'm getting errors like 
> this:

I figured it out :)

> dsync-local(david at mandelberg.org)<...>: Error: dsync(...): Received 
> unexpected input d != N

To debug this, I changed dsync_remote_cmd to a script with these contents:

tee /tmp/tmp.MsfWIQCvNk/outbound.log | nc.openbsd -U 
/run/dovecot/dovecot-replication-client | tee 

Then looking at the inbound.log file, the lines that seemed to be 
causing the "d != N" errors looked like this:

dsync-remote(david at mandelberg.org)<...>: Error: dsync(local): Remote 
dsync doesn't use compatible protocol

I had written a wrapper script in python that did this:

username = sys.stdin.readline().rstrip('\n')
os.execvp('doveadm', ('doveadm', 'dsync-server', '-u', username))

Apparently sys.stdin.readline() reads more than just the one line from 
stdin, so it was consuming the VERSION line.

The actual issue was totally my fault for the wrapper script, but is 
there any chance dovecot could log the "Remote dsync doesn't use 
compatible protocol" lines instead of (or in addition to) sending them 
to the other end? That would have saved some debugging effort.

More information about the dovecot mailing list