[plug] tip: weird ssh/scp/sftp hangs, cvs hangs

Craig Ringer craig at postnewspapers.com.au
Sun May 9 03:42:58 WST 2004


On Sun, 2004-05-09 at 03:03, Craig Ringer wrote:

[added info at bottom] 

> Hi folks
> 
> This message is badly written. Sorry, but it's 3:00AM, and I'm just
> trying to get this out quickly, for the archives as much as anything -
> and for the sake of anybody else's sanity who may run into this later.
> \
> If at you ever encounter some of the following symptoms:
> 
> cvs using :ext: with ssh hangs indefinitely instead of exiting, leaving
> the cvs server process hanging on read() (taking a kill -9 to get rid of
> it). Using :fork: on the CVS server, it works fine. sshd processes are
> also left dangling after the client's ssh is killed. Tweaking
> compression, privsep, etc don't seem to help.
> 
> ssh works fine, as does ssh port forwarding etc, but sftp hangs when
> trying to copy a file and scp hangs _after_ copying a file.
> 
> ssh hangs when you do this:
> cat /some/local/file | ssh server "cat > /tmp/stuff"
> ... but works fine for an interactive shell and port forwarding.
> 
> ... consider the possibility that you have a bad hosts entry or reverse
> DNS entry for the client. I spent quite a bit too long tearing my hair
> out over this, as even at DEBUG2 sshd and ssh showed no useful info,
> there was nothing interesting in the tcpdumps, etc. I could scp
> server->client but not client->server. I eventually removed an IPv6
> hosts entry from the server's hosts file ... and it all worked again. I
> don't see what's different about that entry, none of the others (v4 or
> v6) have ever caused a problem, but nonetheless pulling it worked.
> 
> The symptoms of this problem are just _bizarre_.

I have since worked out that the second half of this problem was an MTU
problem. The tweak to the hosts file fixed scp, cat|ssh, and sftp ...
but not, it turns out, the original CVS over ssh problem. Lowering my
local MTU seems to have fixed CVS over ssh. Weird in the extreme, but
that's what can be expected from networking issues, especially ones
related to MTU issues.

Anyway, perhaps this info will be useful to someone else who finds
themselves bashing their heads against this later.

Craig Ringer




More information about the plug mailing list