How do I fix this Subversion MKCOL error?

When I commit I get this error from Subversion:

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.example.com)

Solution 1:

This happens when you have added a directory that someone else has also added and already committed. The error message on a commit is really confusing, but if you do an svn up instead you'll see this message:

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

To resolve the issue, remove your directory (or move it aside) and do an svn update to get the version on the server and re-do your changes.

As a general rule, be sure to do svn update since the error messages tend to be more helpful.

Solution 2:

This happens when you have added a directory that someone else has also added and already committed.

This is something to indicate conflict but at Directories level (just to understand).

To resolve this, just do svn update before committing your changes