Ben J. Christensen

Software Development and Other Random Stuff

Useless SVN Error Message: Network connection closed unexpectedly

If you’re trying to do a subversion checkout using svn+ssh like this:


svn co svn+ssh://hostname/path

… and are getting a useless error like this …

svn: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: Network connection closed unexpectedly

Try removing .ssh/known_hosts (which fixed my issue) or ensure that the private/public keys in .ssh have the right permissions, such as this:

benjchristensen-notebook:~ benjchristensen$ ls -al .ssh/
drwx------ 6 benjchristensen staff 204 Jun 1 09:30 .
drwxrwxrwx+ 39 benjchristensen staff 1326 Jun 1 09:24 ..
-rw------- 1 benjchristensen staff 1743 Jun 1 09:17 id_rsa
-rw-r--r-- 1 benjchristensen staff 423 Jun 1 09:17 id_rsa.pub
-rw-r--r-- 1 benjchristensen staff 413 Jun 1 09:30 known_hosts

Advertisement

Filed under: Tools

4 Responses

  1. Rick says:

    OK. Here’s how I fixed this (on Mac OS X, but fix should work on any client)

    This particular issue arises when you are using a non-standard port (let’s say 12001 for sake of example) for your SSH server.

    Apparently the SVN client experiences syntax errors when given a port address on a command line like this one:

    svn list svn+ssh://username@domainname.com:12001/home/username/svn/myproject

    So, to fix this, you need to create a client-side config file for SSH like this:

    cd ~
    cd .ssh
    vi config (create a config file like the one that follows)
    :w
    :q

    Config file located in ~/.ssh/config:

    Host domain.com
    User username
    Port 12001

    Then, issue your svn+ssh command WITHOUT the port like this:

    svn list svn+ssh://username@domain.com/home/username/svn/myproject

    That’s it!

    Hope that helps.
    Rick

  2. mirabilos says:

    Same problem, can checkout one repo from the server but not another. Just ssh works, and it uses port 22, so no problem there either. WTF?

  3. [...] SVN Error Message Ever Development, Rants Add comments Total props go to Ben Christensen for this little gem that had me slamming my head against the wall. If you’re trying to [...]

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Twitter Updates

View Ben Christensen's profile on LinkedIn
Follow

Get every new post delivered to your Inbox.