You are here: Home Blog Subversion: MKCOL 405 Method Not Allowed

Subversion: MKCOL 405 Method Not Allowed

by Dan Fairs last modified Sep 11, 2007 08:55 AM
Having fixed extensive breakage after an update to Apache 2.2, I was left with one final, strange error message to solve.

I hope this helps some other poor person before they tear all their hair out.

This was driving me up the wall.

$ svn co -N https://repo/svn/fez
$ cd fez
$ mkdir -p qwacks/trunk qwacks/tag
$ cp -R ~/qwacks/* qwacks/trunk
$ svn add qwacks
A    qwacks
A    qwacks/trunk
AM   qwacks/trunk/
$ svn commit -m "initial import"
Adding         qwacks
svn: Commit failed (details follow):
svn: MKCOL of '...': 405 Method Not Allowed (https://repo)
svn: Your commit message was left in a temporary file:
svn:    '/Users/dan/tmp/fez/svn-commit.tmp'

What?! What does that mean:

svn: MKCOL of '...': 405 Method Not Allowed

Much Googling suggested that either a firewall was blocking DAV requests, or my Apache server was configured to reject them. The latter I considered a possibility, since I'd just spent the last hour fixing my config. Poring over the files yielded nothing.

Even worse, adding other files and folders to the repository worked.

Which - had I not had a beer first, I would have realised much sooner - meant there was something wrong with the 'qwacks' directory specifically.

The directory already existed in the Subversion repository - I hadn't realised that I'd already added it, and of course I did a non-recursive initial fetch, so I didn't spot it.

Ultimately, the error was therefore mine - trying to add a directory that already existed in source control. However, a more descriptive error message would have been nice!

Filed under:
Raphael says:
Sep 30, 2010 04:15 PM
It helped me.
Robin says:
Sep 30, 2010 04:15 PM
Thanks, it helped!
Craig says:
Oct 13, 2010 09:45 PM
Thanks. The error message is horrible.
Eric Grejda
Eric Grejda says:
Nov 03, 2010 04:03 PM
Thanks for this post - it's just what I needed to figure out what was happening at work.
jc says:
Dec 06, 2010 07:00 AM
Helped me too. What's wrong with a nice simple message along the lines of "you're trying to add a directory that already exists in svn you doofus"
gargsuchi says:
Dec 30, 2010 05:53 AM
Thanks a lot - I was getting the same error - and thankfully after googling it, i reached here. Saved me a lot of time.
Ken Seehart
Ken Seehart says:
Jan 07, 2011 04:13 AM
+1 thanks, helped me too

+1 for better message
Rob says:
Jan 10, 2011 01:36 PM
Cheers buddy, really helped. Stupid error message should be replaced with a human-readable one!
Dragos says:
Mar 18, 2011 03:13 PM
Helped a lot, thanks :)
Tom says:
Apr 28, 2011 07:47 PM
So how do you fix this error? I don't know why it wants to add something that already exists nor do I know how to tell it to stop trying.
Dan Fairs
Dan Fairs says:
May 02, 2011 05:55 PM
It's so long ago now, but... I expect you'll need to move the directory you added yourself somewhere else temporarily (you might need to svn rm it, if you've already svn add'ed it) then svn up, to pull down the repo version, then put your changes back over the top.
Darren says:
Apr 29, 2011 11:57 PM
Helped me too, thanks!
Robert says:
May 04, 2011 07:14 PM
Glad I google'd this before spending too much time on it. I use SVN to keep home and office computers in sync for documents I work on both places and this popped up today. I forgot I added the directory last night from home. I didn't pull an update before re-creating the same directory today at work.

Once I realized (with your help) what happened, I knew what to do which was exactly what you were advising Tom. Moved the whole directory off, SVN update, merge the new docs into the SVN'ed version, and re-commit.

Dan Fairs
Dan Fairs says:
May 06, 2011 09:32 AM
Thanks for confirming that method works!
Mathijs Segers
Mathijs Segers says:
May 20, 2011 08:29 AM
Thanks for putting this up, the error was pretty much unknown to me.
carlos says:
Jun 22, 2011 11:24 PM
so... any one knows how to fix this? I mean: I don't care you stupid svn!! just overwrite that file dir or whatever and let me do my work!! I WANT you to overwrite that thing!!

Sorry... svn is new for me, I dont konw nothing about it, and I have to manage the svn server, its my job... :(
cristian says:
Aug 11, 2011 08:18 PM
gracias =)
szir says:
Aug 15, 2011 02:39 PM
Thanks for sharing this, it helped me too.
I just upgraded Apache (2.0 win32 to 2.2 x64) and php (5.2 to 5.3 x64) and I was fighting with mod_security2 all day to get SVN working (among other things).
Lesson: Always Update befor Commit even if you are the only one using the repo :)
zenubis says:
Sep 24, 2011 06:10 AM
it helped me too! +1
~A! says:
Oct 09, 2011 04:51 PM
Much hair pulling avoided. Thank you.
Add comment

You can add a comment by filling out the form below. Plain text formatting.

Stereoplex is sponsored by Fez Consulting Ltd