"Network connection closed unexpectedly" upon svn checkout

conbask picture conbask · Sep 5, 2010 · Viewed 45.1k times · Source

When I attempt to checkout:

svn checkout svn+ssh://serveradmin%[email protected]/home/87292/data/svn/repository/trunk .

I get this (unhelpful) error:

svn: Network connection closed unexpectedly

What's happening?

Answer

Joel J. Adamson picture Joel J. Adamson · Sep 6, 2010

This can happen due to an authentication failure. You may have cached credentials that do not match the site you're trying to access. You may need to register an SSH key with the site.

As suggested by the notalbert below, use SVN_SSH flag to get the detailed error in verbose mode

export SVN_SSH="ssh -v "

You might see some output like this on stderr,

Add correct host key in /home/jcrawford/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/jcrawford/.ssh/known_hosts:4
  remove with: ssh-keygen -f "/home/jcrawford/.ssh/known_hosts" -R 192.168.0.107
ECDSA host key for 192.168.0.107 has changed and you have requested strict checking.
Host key verification failed.

remove the line entry belonging to your svn server IP address, in my case it is 192.168.1.107, from the file ~/.ssh/known_hosts