trust your technolust

Friday, December 16, 2005

Troubling SVN Error

There is a somewhat rare subversion error out there, in which you can import files but not add them. This is rather infuriating, as you often add your whole project to source control, work on it for a month, and then try to add a file and find that subversion has just broke. Really, it didn't just break, it was always broken and you never knew it. Googling for the answer won't help (well, maybe it will now), because no one seems to know the answer. But, lucky you! I have your answer!

Here's the situation: you are running a website package (like drupal). This package puts up fancy 404 error pages, possibly sends you to the root page. When you type in http://www.mywebsite.com/this_page_doesnt_exist.html, instead of an ugly "404 Document Not Found", you get a pretty "302 Found http://www.mywebsite.com/404.html", which causes your browser to redirect. This is good for users - people don't get much out of the traditional error message. This is bad for svn - when you say "svn add" and then commit, it says "Hi! This file already exists!", which causes svn to tell you: "svn propfind request failed", "302 Found"... less than useful.

So, you already see the answer now, cunning user: go to your apache subversion config, and add the simple statement: "ErrorDocument 404 default" (and reload apache). Users get pretty errors, subversion gets less confused, you get to add files. Server defenestration averted.

Thats it! You're done! Go and add new files with abandon!

11 Comments:

Anonymous Anonymous said...

After a few hours of searching/testing/failing... the answer! Many thanks!!!

11:22 PM

 
Blogger method said...

You, my friend, have saved me a lot of grey hairs. Thanks!

11:26 AM

 
Anonymous Anonymous said...

THANK YOU!

What a horrible, horrible error.

Afflicted version: 1.1.4 RHEL4, Mar 2007

7:03 PM

 
Anonymous Anonymous said...

Great, save the my day

7:14 PM

 
Anonymous Anonymous said...

thank you VERY VERY much!!
posts like this one are invaluable..
thank you again and again and again and again and again and again...
and tomorrow too :D

11:16 AM

 
Anonymous buzz said...

Yeeeha!

Thank you very much. After an hour of searching or so I finally found your post and it worked :D

12:01 PM

 
Blogger Matt said...

that took me two hours until I found your page on google. I was about to pull my hair out!!!

6:35 PM

 
Anonymous Jason Dean said...

Thanks for the fix. Unlike the others who have commented, I found your site after only a few minutes of searching. I was not even close to upset. But I am glad you saved me some pain.

10:57 PM

 
Blogger David said...

google code does this when it decides that svn client is a spyware and should show a captcha page instead of sending files. Happened after I cancelled an update - went to resume the update and now 302 every time.

11:29 AM

 
Anonymous Anonymous said...

Thank you, that solved it for me too.

7:10 AM

 
Blogger hQuse said...

Thank you! Saved me many hours.

2:58 AM

 

Post a Comment

<< Home