Skip to content

Protocol Version Mismatch - Shell appears clean and versions match #1015

@mewoocat

Description

@mewoocat

I want to copy some files from a remote host to my local machine and the files are owned by a different user. My user has sudo permissions so I provided sudo rync as the --rsync-path. I also forced pseudo tty allocation via the ssh option in order to get a prompt to enter the password for the remote user.

However, when running

rsync -vvv --dry-run -Aavx -e "ssh -tt" --rsync-path "sudo rsync" "maple:/var/lib/nextcloud" "/run/media/eXia/server-backup/nextcloud-backup_$(date +"%Y%m%d")/"

I get this protocol mismatch error where the remote version is a large number: 1685418843

cmd=ssh -tt machine=maple user=<NULL> path=/var/lib/nextcloud
cmd[0]=ssh cmd[1]=-tt cmd[2]=maple cmd[3]=sudo rsync cmd[4]=--server cmd[5]=--sender cmd[6]=-vvvvnlogDtpArxe.iLsfxCIvu cmd[7]=. cmd[8]=/var/lib/nextcloud
opening connection using: ssh -tt maple "sudo rsync" --server --sender -vvvvnlogDtpArxe.iLsfxCIvu . /var/lib/nextcloud  (9 args)
msg checking charset: UTF-8
(Client) Protocol versions: remote=1685418843, negotiated=32
protocol version mismatch -- is your shell clean?
(see the rsync manpage for an explanation)
[Receiver] _exit_cleanup(code=2, file=compat.c, line=622): entered
rsync error: protocol incompatibility (code 2) at compat.c(622) [Receiver=3.4.1]
[Receiver] _exit_cleanup(code=2, file=compat.c, line=622): about to call exit(2) (DRY RUN)

I checked for any startup commands that may run for the remote non interactive shell via

ssh maple -- : > out.dat

which creates a zero byte file which seems to indicate no garbage is getting outputted to the shell

$ ls -al out.dat
.rw-r--r-- 0 eXia 20 Jun 13:40  out.dat

I also checked that the local and remote versions of rsync are in sync

local:

$ rsync --version
rsync  version 3.4.1  protocol version 32
Copyright (C) 1996-2025 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, symlinks, symtimes, hardlinks, hardlink-specials,
    hardlink-symlinks, IPv6, atimes, batchfiles, inplace, append, ACLs,
    xattrs, optional secluded-args, iconv, prealloc, stop-at, no crtimes
Optimizations:
    SIMD-roll, no asm-roll, openssl-crypto, no asm-MD5
Checksum list:
    xxh128 xxh3 xxh64 (xxhash) md5 md4 sha1 none
Compress list:
    zstd lz4 zlibx zlib none
Daemon auth list:
    sha512 sha256 sha1 md5 md4

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.

remote:

$ ssh maple rsync --version
rsync  version 3.4.1  protocol version 32
Copyright (C) 1996-2025 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, symlinks, symtimes, hardlinks, hardlink-specials,
    hardlink-symlinks, IPv6, atimes, batchfiles, inplace, append, ACLs,
    xattrs, optional secluded-args, iconv, prealloc, stop-at, no crtimes
Optimizations:
    SIMD-roll, no asm-roll, openssl-crypto, no asm-MD5
Checksum list:
    xxh128 xxh3 xxh64 (xxhash) md5 md4 sha1 none
Compress list:
    zstd lz4 zlibx zlib none
Daemon auth list:
    sha512 sha256 sha1 md5 md4

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.

Any ideas what else might be causing this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions