Saturday, May 20, 2006

rsync error / csh bug?

one of our users complaining that he having a problem with his rsync script. the error was:
protocol version mismatch - is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(62)

there is a good way on how to debug this error:

is your shell clean

The "is your shell clean" message and the "protocol mismatch" message are usually caused by having some sort of program in your .cshrc, .profile, .bashrc or equivalent file that writes a message every time you connect using a remote-shell program (such as ssh or rsh). Data written in this way corrupts the rsync data stream. rsync detects this at startup and produces those error messages. However, if you are using rsync-daemon syntax (host::path or rsync://) without using a remote-shell program (no --rsh or -e option), there is not remote-shell program involved, and the problem is probably caused by an error on the daemon side (so check the daemon logs).

A good way to test if your remote-shell connection is clean is to try something like this (use ssh or rsh, as appropriate):

ssh remotesystem /bin/true > test.dat

That should create a file called test.dat with nothing in it. If test.dat is not of zero length then your shell is not clean. Look at the contents of test.dat to see what was sent. Look at all the startup files on remotesystem to try and find the problem.

refer to

and in my case, it is because of the csh error or is it bug? somehow once csh executed this is the error message.
free(2a95e9b7c0) above top of memory. (memtop = 5c2800 membot = 58d000)

no idea what it mean (maybe related to memory problem... i dunno) but for temporary solution i changed the permission of /etc/profile.d/z-lti.csh to 600, so the csh will not sourcing this file when the user uses csh. the error gone & he able to rsync :)

No comments: