08.19.05

Weird Subversion Corner-case

Posted in Programming at 11:49 am

I’ve been using Subversion for real development for a few months now. I’m mostly surprised this didn’t come up sooner.

It seems subversion doesn’t handle the case where two different people add the same file at the same time. The second person to check in won’t be able to. It fails for directories, too, and the error message can be confusing.

When you do an svn up you’ll see a message like this:

bash-2.05b$ svn up
svn: Failed to add directory 'baz': object of the same name already exists

But on a commit you’ll see this:

bash-2.05b$ svn commit -m "testing subversion, still"
Adding         baz
svn: Commit failed (details follow):
svn: MKCOL of '/viper/!svn/wrk/6b9bcd38-b2fe-0310-95ff-9d1a44098866/sandboxes/ohammersmith/trunk/baz': 405 Method Not Allowed (http://svn.motricity.com)

If it’s a file, the error message is much more useful.

So the moral of the story is, make sure you do an svn up before you attempt a commit. You should do it, anyway, and the error messages are way more helpful.

9 Comments »

  1. Kartik Shah said,

    08.08.06 at 11:44 pm

    Thank you.

    This post saved me from loosing my mind. It lead me to fix the same problem I was facing.
    1. Took backup of folder that got added simulataneously from two machines.
    2. I deleted the folder on my local machine
    3. Then did update from SVN
    4. Overwrote the folder from backup and then commit.

    Thanks again.

  2. otto said,

    08.09.06 at 9:04 am

    Kartik,

    You’re welcome. I’ve been surprised at how much traffic this particular post gets. :)

  3. Matthias Bach said,

    09.06.06 at 4:28 pm

    Thanks, this saved my world. I was already going mad about loosing a week of coding. So this is way you shall fork ;)

  4. lucaspirola said,

    01.15.07 at 7:41 am

    tahnk, thank and thanks again, i lost a few hours trying fix this issue, u save my day, thanks!

  5. Raghu said,

    09.04.07 at 2:39 am

    Thanks a lot. Instead of Wierd Subversion error, please change the topic to Error:MKCOL 405 method not allowed so that google lists this at the top.

    -raghu

  6. skeletor said,

    09.15.07 at 6:46 pm

    Big thanks from me to, I had almost lost all my hair before I found this

  7. MAtej said,

    10.25.07 at 9:14 am

    Thank, you.
    Your post saved the day.

  8. fiw said,

    03.03.08 at 1:55 pm

    I came here from
    http://www.culturezoo.com/nwa/article/45/svn-mkcol-405-errors

    where I arrived from a twingine search.

    It’s useful

  9. Shanthi said,

    05.08.08 at 11:43 am

    This was a really useful post and it helped fix the problem. I asked the user who created and committed a folder with same name//location as I had give to delete his .. because for some strange reason .. I could not do it .. and commited my changes.

RSS feed for comments on this post · TrackBack URL

Leave a Comment