Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem connecting to svn (400: Bad Request)

Summary: I'm having some svn trouble, and after "debugging" it for a while, I'm not sure where to go from here. I figure someone else might have run into this problem before. The problem appears to be that I'm behind a transparent proxy my ISP uses, but this doesn't explain all the facts.

Details: I'm having trouble connecting my computer to an svn repository in my own domain, hosted on DreamHost. I'm using tortoise-svn's repo browser to connect, but after performing any action (adding a folder, expanding the source tree...) I get a "400: Bad Request message".

DreamHost and the svn faq both say that the problem could be that I'm behind some kind of proxy that my ISP has set up, without me having any control over it. The problem is, I have another repo that works just fine. That makes me a little unsure that that's really the problem, since I assume the proxy would stop every svn connection.

On the other hand, my friend manages to connect fine using a different ISP.

I'd appreciate any help with why this is happening (and only with one repo and not another), and where I can go from here.

Thanks in advance for any help.

[EDIT 1]: I also tried connecting to port 81 instead of 80, the DreamHost svn server doesn't seem to accept that (I get a "could not connect to server" error).

[EDIT 2]: Someone suggested, as per the svn faq, to connect using https. This would probably work, however, my DreamHost account doesn't have ssl right now, and adding it would cost me an additional charge per month. I'll probably do it if I have no other option, but I'd prefer to find a different solution, if I can, to keep costs down.

P.S. I wasn't sure whether to post this here or on ServerFault, since it's an svn question and I figure the most likely people to run into this problem are programmers.

P.P.S. If it helps anyone, I sniffed the traffic from my computer to the host with WireShark, and the last sent message (originating from my machine) is this:

REPORT /**** HTTP/1.1
Host: svn.***.com
User-Agent: SVN/1.6.5 (r38866)/TortoiseSVN-1.6.5.16974 neon/0.28.6
Connection: TE
TE: trailers
Content-Type: text/xml
Accept-Encoding: gzip
DAV: http://subversion.tigris.org/xmlns/dav/svn/depth
DAV: http://subversion.tigris.org/xmlns/dav/svn/mergeinfo
DAV: http://subversion.tigris.org/xmlns/dav/svn/log-revprops
Content-Length: 109
Accept-Encoding: gzip
Authorization: Basic ***=

<?xml version="1.0" encoding="utf-8"?><S:get-locks-report xmlns:S="svn:" xmlns:D="DAV:"></S:get-locks-report>
like image 362
Edan Maor Avatar asked Jan 24 '23 05:01

Edan Maor


2 Answers

I found this on the TortoiseSVN site: 400 Bad Request

REPORT request failed on '...' REPORT of '...': 400 Bad Request (http://...)

You're behind a firewall which blocks DAV requests. Most firewalls do that. Either ask your Administrator to change the firewall, or access the repository with https:// instead of http:// like in https://svn.collab.net/repos/svn/ That way you connect to the repository with SSL encryption, which firewalls can't interfere with (if they don't block the SSL port completely).

like image 124
crashmstr Avatar answered Feb 01 '23 03:02

crashmstr


I use Dreamhost SVN set up on my domain and access it through ssh+svn. This protocol doesn't need an SVN server set up at DH. Instead, it'll access your account over SSH and execute local shell commands to SVN.

The URL for the repository ends up being:

svn+ssh://[email protected]/home/yourDHusername/svn/yourrepositoryname/

This only works well if you set up passwordless SSH access to your DH shell account. To do this, you'll want to generate a public/private key pair, the private kept on your machine and the public uploaded to your DH shell account in ~/.ssh/authorized_keys. How you set this up exactly depends on your choice of OS. See e.g.:

http://blog.dreamhosters.com/kbase/index.cgi?area=138

like image 37
user183754 Avatar answered Feb 01 '23 04:02

user183754