Protocol version mismatch - is your shell clean?

Discussion in 'Installation, Update and Configuration' started by figjam, Dec 20, 2016.

  1. figjam

    figjam Mega Poster

    Messages:
    121
    Hi,

    Since updating one of my Virtuozzo 6 servers to all the latest patches last week, I am unable to migrate VPSs from a VZ4.0 node. It fails with the following error:

    src rsync call: rsync -E -q -a -H -H --sparse --numeric-ids --timeout 3600 --fdin 6 --fdout 9 --write-timeout 3600 --delete /vz/private/752/ve.conf 0.0.0.0:/dummy
    protocol version mismatch - is your shell clean?

    I have been through all the documentation about getting rid of any output on ssh login and put .hushlogin files at both ends. I have also tested that running /bin/false via ssh on the remote host and redirecting to a file produces an empty file (zero bytes) to confirm that there is no output. Migrating to other VZ6 servers that have not yet been updated works fine.

    If anyone has any suggestions, they would be greatly appreciated.

    Thanks,

    Andrew
     
  2. Pavel

    Pavel A.I. Auto-Responder Staff Member

    Messages:
    478
    Hello Andrew,

    Can you please check if vz4.0 hosts are up-to-date as well?
    What is the version of rsync-static package? (rpm -q rsync-static)
     
  3. figjam

    figjam Mega Poster

    Messages:
    121
    Hi Pavel,

    It all appears to be up to date.

    # vzup2date -s -m batch list
    Downloading releases information. Please wait...done
    Downloading updates information for 4.0.0. Please wait...done
    Downloading detailed updates information. Please wait...done
    Your Parallels Virtuozzo Containers 4.0 installation is up to date

    # rpm -q rsync-static
    rsync-static-2.5.7-1.10.swsoft

    Thanks,

    Andrew
     
  4. Pavel

    Pavel A.I. Auto-Responder Staff Member

    Messages:
    478
  5. Pavel

    Pavel A.I. Auto-Responder Staff Member

    Messages:
    478
    On a second thought - it might be irrelevant...
    Check this snippet from man rsync:
    Code:
    DIAGNOSTICS
           rsync  occasionally  produces  error  messages that may seem a little cryptic. The one that seems to cause the most confusion is "protocol version mismatch -- is
           your shell clean?".
    
           This message is usually caused by your startup scripts or remote shell facility producing unwanted garbage on the stream that rsync is using for  its  transport.
           The way to diagnose this problem is to run your remote shell like this:
    
                  ssh remotehost /bin/true > out.dat
    
           then  look  at out.dat. If everything is working correctly then out.dat should be a zero length file. If you are getting the above error from rsync then you will
           probably find that out.dat contains some text or data. Look at the contents and try to work out what is producing it. The most common cause is  incorrectly  con‐
           figured shell startup scripts (such as .cshrc or .profile) that contain output statements for non-interactive logins.
    
           If  you are having trouble debugging filter patterns, then try specifying the -vv option.  At this level of verbosity rsync will show why each individual file is
           included or excluded.
    
    Could you try doing the same diagnostics step and posting here the strings from out.dat ? If there's nothing internal obviously.
     
  6. figjam

    figjam Mega Poster

    Messages:
    121
    Hi Pavel,

    The file is empty, upgrading rsync-static didn't work either. This only happened after I upgraded the VZ 6 server to 6.0.11-3488. I have no problems migrating to servers with versions 3466 and 3476. I had migrated 20+ VPSs to this server until the update. What changed in the 3488 build that could have caused this issue?

    Thanks,

    Andrew
     
  7. Pavel

    Pavel A.I. Auto-Responder Staff Member

    Messages:
    478
    Hello Andrew,

    There were plenty of changes, it's difficult to pinpoint the change that introduced the issue.
    Could you please contact technical support for a deeper investigation? We might need access to your environment to investigate this, it's better to arrange this via the usual support channel.
     
  8. Elizine

    Elizine Bit Poster

    Messages:
    2
    There is a simple way to test if your shell is clean, for an ssh connection: run a command from the ssh connection, rather than starting an interactive shell. The false command will immediately terminate without producing any output, so it is a good test:

    Code:
    bash$ ssh remotehost false
    Enter passphrase for key '/home/user/.ssh/my_private_key': 
    bash$
    If that command line produces any output, one of your startup scripts is to blame:

    Code:
    bash$ ssh remotehost false
    Enter passphrase for key '/home/user/.ssh/my_private_key': 
    Welcome to RemoteHost!
    
    This system is company property and is provided for authorized use only, 
    as set forth in applicable written policies. Unauthorized use is prohibited 
    and may be subject to discipline, civil suit and criminal prosecution.
    
    Welcome back - You last logged in 16 days ago...
    bash$
    Another thing to check if you are getting this error is whether rsync is installed and locatable by ssh:

    Code:
    bash$ ssh remotehost "rsync --version"
    Enter passphrase for key '/home/user/.ssh/my_private_key': 
    rsync  version 3.0.9  protocol version 30
    Copyright (C) 1996-2011 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
    
    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.
    bash$[/ode]
    If rsync is not in the path, you will instead see something like:
    
    [code]bash$ ssh remotehost "rsync --version"
    Enter passphrase for key '/home/user/.ssh/my_private_key': 
    bash: rsync: command not found
    bash$
    You can fix this by either installing rsync, or if it is installed but in an unusual location, passing the location to the rsync command line:

    Code:
    rsync -avvvz -e "ssh -i /home/thisuser/cron/thishost-rsync-key" \
        --rsync-path="/usr/local/bin/rsync" \
        remoteuser@remotehost:/remote/dir /this/dir/
     
  9. figjam

    figjam Mega Poster

    Messages:
    121
    Hi Elizine,

    The file is empty and both servers show "protocol version 29". The rsync called by vzmigrate is actually located in /usr/local/share/vzlinmigrate/rsync and it would be very difficult to get vzmigrate to change the parameters. I gave up and reinstalled a spare server with VZ 4.7 and so far it's working reasonably well as a jumphost to move the VZ 4.0 VPSs to VZ 6.
     
  10. Pavel

    Pavel A.I. Auto-Responder Staff Member

    Messages:
    478
    Hello figjam,

    Glad to hear it works in the end.
    Too bad we couldn't figure it out. If you manage to come across the same issue - please do not hesitate to contact technical support, we'd like to investigate it deeper with direct access.

    Thanks in advance!
     

Share This Page