SVN working fine and then "svn: OPTIONS 200 OK" error and "does not exist"
SVN was working just fine until a few minutes ago -- I can still browse my repository at http://svn.example.com/myrepo but when I try to perform any operation, including svn up, I get:
svn: OPTIONS开发者_高级运维 of 'http://svn.example.com/myrepo': 200 OK (http://svn.example.com)
And when I tried svn cleanup http://svn.example.com/myrepo
just to see what would happen, I got:
svn: 'http://svn.example.com/myrepo' does not exist
Again -- typing that into the browser, I can still browse the repository just fine. Whats going on??
Okay, so it turns out the solution to this problem was very basic – and also very complicated.
The simple answer:
The hostname svn.mywebsite.com
does not exist (at least, not as far as my development server is concerned).
For anyone else who's getting this problem, I strongly advise approaching the problem from the assumption that for whatever reason, your client simply cannot locate the SVN server.
--
The complication:
Now for me, it turned out to be a little more complex, because as I mentioned before, it WAS working -- and then it stopped.
The reason for this, in case you are interested, is that our SVN server lives on a web server along with our main application (located at http://www.mywebsite.com
), which happens to be mirrored on another server, and the DNS records for mywebsite.com
are being distributed on an A-B pattern between the two servers. Since the SVN client on my development server couldn't find svn.mywebsite.com
, it was looking for simply mywebsite.com
. Once it connected to the "A" server, where the virtualhost records exist for the SVN server, Apache took over and served the content appropriate to svn.mywebsite.com
.
But at some point, my DNS cache was refreshed, and with no application logic available to quietly send the user back to the "A" server, my development server began resolving mywebsite.com
to the "B" server -- where SVN hasn't even been installed.
Obviously, that's when the SVN client started saying "uh, gee, there ain't no such server." (Who knew thats what OPTIONS blah blah 200 OK meant?)
Why I'm an Idiot
Here's where the inevitable ID10T
error comes into play. The reason I could consistently browse to "http://svn.mywebsite.com/myrepo" in Firefox, was because I had manually created a host entry on my PC pointing to the IP address of the "A" server.
If I'd remembered that sooner, I would have saved myself a lot of time – and a few precious Ibuprofen tablets. :)
Similar problem here, with a different cause and solution.
The simple answer
Downgrade the Subversion client.
The more complicated answer
Previously, I'd been using 1.6.11 (particularly 1.6.11-SlikSvn-tag-1.6.11@935062-X64
) and that worked fine. Upgraded to 1.6.17 (1.6.17-SlikSvn-tag-1.6.17@1130898-X64
) and then started getting the OPTIONS of ... 200 OK
error. Downgrading again fixed it. All this was made more confusing by the fact that (obviously) I could still browse the repository in my browser, and also in IntelliJ which, I assume, uses its own SVN client.
Why I'm an idiot
Since I work across two SVN repositories, and the other one works fine with both versions of the client, I didn't notice the problem until a few days after I upgraded, so I didn't immediately figure out the cause. If I'd realised that sooner, I would have saved myself a lot of time - though I stopped just short of hitting the painkillers!
</shameless plagiarism of Brian Lacy's answer>
I had this issue after upgrading my SVN server to 1.7
I fixed this by adding the following to my apache location directive:
SVNAdvertiseV2Protocol Off
This "svn: OPTIONS of" error can also show up if your server uses the svn port but you specify the http protocol on your url.
That is, I would get the error when I tried:
svn checkout http://genericsite.com/someproject/trunk someproject
but what I ought to have been doing was:
svn checkout svn://genericsite.com/someproject/trunk someproject
I got the same problem cause I tried to add a second SVN Repo. After reading this post, I recognized, that I had to add another Location set in my SVN Config-File (in my case: /etc/apache2/mods-enabled/dav_svn.conf) with different paths. Now its working after restarting Apache.
Why not one more solution for a ridiculously ambiguous error message? In my case, the SVN repo was created by the root user so permissions were wrong.
chown -R apache:apache /var/www/svn/foo
And, since I'm running SELinux, I also did this for good measure:
chcon -R system_u:object_r:httpd_sys_content_t:s0 /var/www/svn/foo
ETA:
An easy to spot symptom of this problem is in your Apache logs. Note, no body sent in response to the OPTIONS request:
"OPTIONS /rancid HTTP/1.1" 200 - "-" "SVN/1.6.11 (r934486) neon/0.29.3"
After the changes:
"OPTIONS /rancid HTTP/1.1" 200 97 "-" "SVN/1.6.11 (r934486) neon/0.29.3"
精彩评论