SVN 405 Method Not Allowed
Asked Answered
B

11

121

I accidentally deleted a folder in SVN and added it back immediately. I ran into an issue with this and my solution ended up removing the folder completely from my local copy as well as the server copy. I can do updates and commits without problems on any other file or folder, but if I try to create a folder with the same name, add, and commit, it gives me the following error:

svn: Server sent unexpected return value (405 Method Not Allowed) in response to MKCOL request for '/svn/www/!svn/wrk/9de0d765-2203-456c-af16-58e792ec7ac0/trunk/htdocs/solutions/medical'

I have run countless cleanups, commits, updates, etc. Nothing resolves the issue. Ideas?

FYI, I do not have the option of renaming the top level folder.

Brewis answered 30/8, 2010 at 15:9 Comment(1)
I tried to do the same while attempting to remove a subdirectory so I could ignore it properly. Somehow it resolved itself and I don't really know what arcane combination of the elements coincided to allow this, so I discarded my question. My new one is: why do we not just all use git?Adrianople
I
170

My guess is that the folder you are trying to add already exists in SVN. You can confirm by checking out the files to a different folder and see if trunk already has the required folder.

Imperious answered 30/8, 2010 at 15:30 Comment(5)
I did verify this on another checked out version. Why my working copy would not update with it, I cannot determine.Brewis
Was the case here as well, but I had to check the folder out in a separate folder (or rather, I renamed it "foo" and svn up'd and got it back, including the "deleted" folder, despite my successful commit of deleting it.)Ginkgo
@Shaji : I understand your case. But how I can still be committed due to this error? Or there is anyway to do, Please tell me. Thanks.Consult
Do a SVN update on the folder, and then attempt the commit again.Befit
This is an annoying error. I checked out a new repository from Github and commit a new folder. It always shows the same error. Tried your solution but it doesn't work.Clambake
L
56

The quickest way for me to fix it was to duplicate the affected folder, and commit it with an alternative name. Then svn mv duplicateFolder originalFolder. Pretty easy.

So, take folder1 and make a folder1Copy:

svn delete folder1
svn add folder1Copy

Commit and update:

svn mv folder1Copy/ folder1/

Commit again and it's fixed.

Lung answered 8/11, 2011 at 3:2 Comment(3)
This worked great for me and is a lot simpler than dealing with a second working copy.Gibbs
Hopefully commit & update isn't a literal command line ... in Unix that would try to do both in parallel.Wisnicki
Brilliant good sir if you come to sunnyvale and somehow find me I will buy you coffee.Posology
G
10

My "disappeared" folder was libraries/fof.

If I deleted it, then ran an update, it wouldn't show up.

cd libaries
svn up

(nothing happens).

But updating with the actual name:

svn update fof

did the trick and it was updated. So I exploded my (manually tar-archived) working copy over it and recommitted. Easiest solution.

Guthrey answered 15/5, 2013 at 13:45 Comment(2)
Agree this is the easiest. Just do "svn up [folder]" instead of "svn up".Abubekr
This solution is the one that worked for me. Thank you.Absolutely
T
4

I just fixed this in my own repository. I'm using TortoiseSVN on Windows, so I'm not sure exactly what commands this translates to on the command line, but here's what I did:

The problematic folder is called lib, and it was due to be added.

  • First I undid the add, so that SVN was no longer paying attention to it.
  • Then I renamed it (to libs, not that that matters) using the Windows context menu, added it, and committed successfully.
  • Finally I renamed it back to lib using TortoiseSVN's context menu (this is probably important), and committed again.
Thoroughfare answered 1/9, 2011 at 15:45 Comment(0)
D
3

I also met this problem just now and solved it in this way. So I recorded it here, and I wish it be useful for others.

Scenario:

  1. Before I commit the code, revision: 100
  2. (Someone else commits the code... revision increased to 199)
  3. I (forgot to run "svn up", ) commit the code, now my revision: 200
  4. I run "svn up".

The error occurred.

Solution:

  1. $ mv current_copy copy_back # Rename the current code copy
  2. $ svn checkout current_copy # Check it out again
  3. $ cp copy_back/ current_copy # Restore your modifications
Disclosure answered 9/9, 2011 at 8:16 Comment(0)
I
3

I had a similar problem. I ended up nuking it from orbit, and lost my SVN history in the process. But at least I made that damn error go away.

This is probably a sub-optimal sequence of commands to execute, but it should fairly closely follow the sequence of commands that I actually did to get things to work:

cp -rp target ~/other/location/target-20111108
svn rm target --force
cp -rp ~/other/location/target-20111108 target-other-name
cd target-other-name
find . -name .svn -print | xargs rm -rf
cd ..
svn add target-other-name
svn ci -m "Re-re-re-re-re-re-re-re-re-re import target"
svn mv target-other-name target
svn ci -m "Re-re-re-re-re-re-re-re-re-re import target"
Isotherm answered 8/11, 2011 at 21:51 Comment(1)
It's the only way to be sure.Gorki
C
1

If you use code.google.com to host your Subversion repository.

You know below things, right?

If you plan to make changes, use this command to check out the code as yourself using HTTPS:

# Project members authenticate over HTTPS to allow committing changes.
svn checkout https://.../svn/trunk/ user-...

When prompted, enter your generated googlecode.com password.
Use this command to anonymously check out the latest project source code:

# Non-members may check out a read-only working copy anonymously over HTTP.
svn checkout http://.../svn/trunk/ ...-read-only

The error you mentioned exactly you are using Non-members may check out a read-only working copy anonymously over HTTP status. Therefore, you can not commit or do anything so far.

You must use Project members authenticate over HTTPS to allow committing changes thing.

It will be fine now.

Consult answered 27/6, 2014 at 8:26 Comment(0)
P
0

The currently added directory is already committed in the repository. So delete the directory in the repository and commit the same directory again.

Playreader answered 2/4, 2013 at 6:45 Comment(0)
H
0

I encountered the same issue and was able to fix it by:

  1. Copy the folder to another place.
  2. Delete .svn from copied folder
  3. Right click the original folder and select 'SVN Checkout'
  4. If you can't find (3), then your case is different than mine.
  5. See if the directory on the REPO-BROWSER is correct. For my case, this was the cause.
  6. Check out
  7. Get back the files from the copied folder into the original directory.
  8. Commit.
Haplo answered 31/12, 2013 at 16:2 Comment(0)
S
0

This means that the folder/file that you are trying to put on svn already exists there. My advice is that before doing anything just right click on the folder/file and click on repo-browser. By doing this you will be able to see all the files/sub-folders etc that are already present on svn. If the required file/folder is not present on the svn then you just delete(after taking backup) the file that you you want to add and then run an update.

Seafood answered 10/11, 2014 at 12:49 Comment(0)
U
0

I got this error because I replaced URL address with new one ending up with "/". I mean record in wc.db database in .svn folder in REPOSITORY table.

When I removed sign: "/" then the error went away.

Underwrite answered 26/4, 2020 at 23:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.