开发者

"Network connection closed unexpectedly" upon svn checkout

When I attempt 开发者_JAVA技巧to checkout:

svn checkout svn+ssh://serveradmin%foo@foo.com/home/87292/data/svn/repository/trunk .

I get this (unhelpful) error:

svn: Network connection closed unexpectedly

What's happening?


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


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


I suspect Joel and Andy have it right.

You can use the ssh verbose flag to help figure out these kind of problems.

export SVN_SSH="ssh -v "
svn checkout svn+ssh://serveradmin%foo/blah blah blah


I had this same error, but for committing a revision. Clearing out .ssh/known_hosts fixed the problem because the SSH keys went stale.


I was connecting to a local network svn and this happened to me from some point on (it actually happens periodically).

All the references I have found surfing mention something related with SSH. SSH may well be the root of my problem too somehow, but I managed to overcome the problem by killing some of the svnserve processes.

I can do this because I know what is the usage of my server, but don't know the relevance of doing this in a server with more concurrence.


If you're using Putty, it saves your login credentials thus might make tortoise give the following error when you try to checkout: Connection closed unexpectedly. If this occurs open up putty and click on default settings so that the Host Name is loaded. Clear the host name and save. This worked for me...


One other reason for getting this "svn: Network connection closed unexpectedly" error which I came across was that the /var was full , which caused for svn in not being able to write anything to disk. so maybe first check your disk space (du -m) before proceeding with the above steps ?


Make sure you did not have a spurious colon in your svn url

It should NOT be:

    user@host.com:/path/to/repo 
                 ^
                 spurious colon should be removed  

but should be:

    user@host.com/path/to/repo


In my case, while using svn+ssh, the error stemmed from the fact that gforge users didn't have home directories. I added them manually and the problem went away.


Check your firewall settings. I had ConfigServer Security & Firewall (CSF) installed on my server which blocked the ssh+svn port 2222. I allowed the ports and was able to perform an update.


I also had this problem after I have set up ssh on my linux server. The problem for me was that I have created the key with puttyGen. The public key file first had to be converted with puttyGen from .ppk file format. After that everything worked like a charm.


Hi I encounter same issue on OS X Yosemite. I read all this answers and @notalbert comment is the path to resolve. It seems that OS X can't handle svn+ssh scheme, so adding

export SVN_SSH="ssh "

to /Users/username/.bashrc is my resolution.

Thanks.


Other possible cause is that subversion is not actually installed in the server (e.g. the repository was moved to a new server).


If you have already set up .bashrc to refer to your key in SVN_SSH but are then using sudo to execute svn the command will not be using your SVN_SSH and you may get this error.

I was using sudo to check out to a new directory I didn't have permission to create, the proper way is to sudo mkdir whatever, then set the correct permissions to allow you to write to it.


E210002: Network connection closed unexpectedly

I had kept getting error above with ssh trying to connect using default port 22. issue resolved after specifying correct port for the host.


just to add my related two cents to an old thread:

I setup my svn version 1.10.4 (r1850624) to use sasl

I was able to checkout my repo using Windows (tortoise) and MacOS, but when I was trying to checkout from another Debian CLI v10 machine, I would get a pair of errors:

svn: E170013: Unable to connect to a repository at URL 'svn://myServer/myRepo'

svn: E210007: Cannot negotiate authentication mechanism

note: if I comment out "use-sasl=true" and make "anon-access = read" in /myRepo/conf/svnserve.conf, then I'm able to checkout on the Debian server (so the server I'm trying to use to checkout has a sasl auth problem, albeit "svnserve --version" shows "Cyrus SASL authentication is available." on both servers, and both can successfully "sudo testsaslauthd -u myUser -p myP@5swd", and tcp 3690 was open between the two servers)

I run svnserve with --log-file /var/log/svn.log, so in there, I was seeing (the OP's problem):

ipAddrOfServerAttemptingCheckout - - ERR - 0 210002 Network connection closed unexpectedly

SOLUTION (for me): on that server attempting checkout, I simply installed libsasl2-modules (where I only needed to install sasl2-bin to get Windows/MacOS to be able to checkout):

sudo apt install libsasl2-modules

now I can checkout from everywhere (and really, I'm now able to "svnsync init", which is when I realized I had an auth problem)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜