Gunn, Bobby
2004-May-03 20:36 UTC
rsync error: error in rsync protocol data stream (code 12) at io.c(189)
Rsync Issue Solaris8 When performing a simple rsync between servers I was getting the following error: root:#> rsync -e ssh -va /export/home/a078479/bob smmk39:/export/home/a078479/ ksh: rsync: not found rsync: connection unexpectedly closed (0 bytes read so far) rsync error: error in rsync protocol data stream (code 12) at io.c(189) root:#> I was thorghrough in setting up rsync to be used between servers and was still getting errors , I did the following to Setup Rsync. Added each host into the /etc/hosts file. Added each users ssh keys from each node to their ./.ssh/authorized_keys so I dont have to use password files or anything of the sort. Added rsync Port Alias to /etc/services: echo "rsync 873/tcp" >> /etc/services Added rsync Daemon to /etc/inetd.conf: echo "rsync stream tcp nowait root /usr/bin/rsync rsyncd --daemon" >> /etc/inetd.conf Recycle (HUP) inetd daemon: for i in `ps -ef |grep inetd | grep -v grep | awk '{print $2}' do kill -HUP $i done And still got the error as indicated below. So I tried to do some debugging with the syntax below. root:#> rsync -e 'ssh -vv -x' -ra /export/home/a078479/bob smmk39:/export/home/a078479/ OpenSSH_3.4p1, SSH protocols 1.5/2.0, OpenSSL 0x0090602f debug1: Reading configuration data /fisc/openssh/etc/ssh_config debug1: Applying options for * debug1: Rhosts Authentication disabled, originating port will not be trusted. debug1: ssh_connect: needpriv 0 debug1: Connecting to smmk39 [172.25.108.30] port 22. debug1: Connection established. debug1: identity file /export/home/a078479/.ssh/identity type 0 debug2: key_type_from_name: unknown key type '-----BEGIN' debug2: key_type_from_name: unknown key type '-----END' debug1: identity file /export/home/a078479/.ssh/id_rsa type 1 debug1: identity file /export/home/a078479/.ssh/id_dsa type -1 debug1: Remote protocol version 1.99, remote software version OpenSSH_3.4p1 debug1: match: OpenSSH_3.4p1 pat OpenSSH* debug1: Local version string SSH-1.5-OpenSSH_3.4p1 debug1: Waiting for server public key. debug1: Received server public key (1152 bits) and host key (1024 bits). debug1: Host 'smmk39' is known and matches the RSA1 host key. debug1: Found key in /export/home/a078479/.ssh/known_hosts:1 debug1: Encryption type: 3des debug1: Sent encrypted session key. debug1: cipher_init: set keylen (16 -> 32) debug1: cipher_init: set keylen (16 -> 32) debug1: Installing crc compensation attack detector. debug1: Received encrypted confirmation. debug1: Trying RSA authentication with key '/export/home/a078479/.ssh/identity' debug1: Received RSA challenge from server. debug1: Sending response to host key RSA challenge. debug1: Remote: RSA authentication accepted. debug1: RSA authentication accepted by server. debug1: Sending command: rsync --server -logDtpr . /export/home/a078479/ debug1: Entering interactive session. debug1: fd 0 setting O_NONBLOCK debug2: fd 1 is O_NONBLOCK ksh: rsync: not found debug2: fd 0 is not O_NONBLOCK debug1: fd 1 clearing O_NONBLOCK debug1: Transferred: stdin 4, stdout 0, stderr 23 bytes in 0.1 seconds debug1: Bytes per second: stdin 34.4, stdout 0.0, stderr 197.7 debug1: Exit status 127 rsync: connection unexpectedly closed (0 bytes read so far) rsync error: error in rsync protocol data stream (code 12) at io.c(189) Here I found out that after secure shelling over to the remote system the rsync command was not being found!! As the user I did a which and found out that rsync was in the /usr/local/bin/rsync so I decided to link rsync to a system binary directory. sdal19:/# ln -s /usr/local/bin/rsync /usr/bin/rsync sdal19:/# which rsync /usr/bin/rsync root:#> rsync -e ssh -va /export/home/a078479/bob smmk39:/export/home/a078479/ building file list ... done bob/ bob/test wrote 129 bytes read 40 bytes 112.67 bytes/sec total size is 0 speedup is 0.00 Success!! Looks like the system or user profile was not setting set when ssh logs in and this simple change will fix it in my case. Bobby Gunn
Tim Conway
2004-May-03 21:11 UTC
rsync error: error in rsync protocol data stream (code 12) at io.c(189)
Standard newbie issue. rsh host command (or ssh host command in your case) does so in a fairly stripped environment, for instance, a small $PATH, which is your issue (unless rsync isn't even installed on smmk39). rsync has aneasy workaround for it. add " --rsync-path=/path/on/the/remote/host/to/rsync " commonly " --rsync-path=/usr/local/bin/rsync ". You can also link it into someplace in your path, if you're the admin, and are going to be having a lot of users doing their own rsync commandlines. The stuff you're doing with services and inetd.conf are irrelevant, unless you're going to run an inetd-managed rsyncd, which is NOT what you are doing or accessing in the commandline given. Also your inet hupping is a bit scary. If you have anything that has the word "inetd" in the ps line, it's going to get a HUP, and many things react to a HUP like to a TERM. I'd suggest a pattern like " /usr/sbin/in[eE]td -s$", as you're on Solaris 8. To call that rsync server, forget the "-e ssh". have this in your /etc/rsyncd.conf: ++++++++++++++++++++++++++++++++++ [home] path = /home ++++++++++++++++++++++++++++++++++ Or tighter yet: ++++++++++++++++++++++++++++++++++ [homeforbob] path = /home/a078479/bob ++++++++++++++++++++++++++++++++++ rsync -va /export/home/a078479/bob smmk39::homeforbob I see, having read to the bottom of your message, that you did the linking thing. That's cool, and well-documented. Glad you figured it out. It's not an rsync issue, but an environmental one. Tim Conway Unix System Administration Contractor - IBM Global Services desk:3032734776 conway@us.ibm.com Rsync Issue Solaris8 When performing a simple rsync between servers I was getting the following error: root:#> rsync -e ssh -va /export/home/a078479/bob smmk39:/export/home/a078479/ ksh: rsync: not found rsync: connection unexpectedly closed (0 bytes read so far) rsync error: error in rsync protocol data stream (code 12) at io.c(189) root:#>
Seemingly Similar Threads
- [Bug 357] New: SSH does not handle "Protocol" option in ~/.ssh/options properly
- With bounds checking patch for gcc-3.1 problems if using AES
- scp hangs
- scp output redirection doesn't work...
- [Bug 357] SSH does not handle "Protocol" option in ~/.ssh/options properly