How to fix Subversion lock error
Asked Answered
B

20

70

How do you fix the Subversion/Subclipse error "Attempted to lock an already-locked dir"?

Googling shows people routinely encounter this error, and the only solution I've seen posted is to run Subclipse's Team->Cleanup command. Unfortunately, I get this error when I run the Team->Cleanup command. Are there any other options?

Boarder answered 18/3, 2012 at 5:8 Comment(0)
B
0

I tried recursively deleting all lock files, but that just resulted the error "Path is not a working copy". I ended up having to do Team->Disconnect and then Team->Share. Upon reconnect, it complained about existing .svn files, which it deleted. Now it seems to be working.

Boarder answered 6/11, 2013 at 14:55 Comment(0)
I
124

I had similar problem. Team->Refresh/Cleanup Solved my problem

Insolence answered 15/2, 2014 at 1:49 Comment(1)
sometimes the Cleanup will not solve the problem, try to delete the lock file in .svn hidden folderWorsley
P
29

I tried all suggestion from this thread but the only one that worked is:

  1. go to the folder on which the project locked folder is stored
  2. execute svn cleanup
Prosecution answered 12/1, 2017 at 18:40 Comment(4)
This worked for me, I think subversion couldn't make cleanup if directory locked from any terminal. thanksEunuchoidism
Worked for mee too, unlike the GUI manipulations in Eclipse. This should be the accepted answer.Atalante
Worked for me too. Unlike any menu option in EclipseDamascus
This Worked for me. Team -> Refresh/Clean Up was not working for me.Lick
S
28

Error : Attempted to lock an already-locked dir svn: Working copy 'C:\work\myproject\workspaces\HPDP' locked.

Solution: Worked for me.

        Right-click on project-->Team-->Refresh/Cleanup
Siliqua answered 19/2, 2015 at 5:57 Comment(1)
This has saved me twice now.Idel
T
14

I get this too. I go to the directory (not in Eclipse) where the files are, go into the .svn dir and delete the file called lock.

Flip back to Eclipse and continue.

There is a similar question here Problems committing file to SVN repository

Tremolant answered 7/3, 2013 at 2:12 Comment(0)
C
12

I solved this problem by doing these:

  1. Right click on your project.

  2. Click on Team

  3. Click Refresh/Cleaup

Counterwork answered 17/2, 2017 at 12:40 Comment(0)
R
8

Just Right Click on Project

  1. Click on Team

  2. Click Refresh/Cleaup

this will remove all the current lock files created by SVN

hope this will help !!!!

Renettarenew answered 15/8, 2019 at 6:24 Comment(0)
D
6

After the same problem with "phantom lock" the only solution was:

1) Disconnect the Project Eclipse->Team->Disconnect (select option to delete .svn folder)

2) Than "reconnect" Eclipse->Team->SVN->Share Project. Ignore the warning about better do an checkout. After this all worked fine.

Cleanup and Restart was no solutions, also Scan Locks did not show anything.

Darwindarwinian answered 26/1, 2017 at 11:10 Comment(1)
This works and can solve the problem within Eclipse.Skysweeper
M
6

We had the same repeating problem. It's a disaster. What can you do if cleanup and unlock does not help because there is no existing lock?

  1. Search the hidden .svn folder in your directory structure. It contains a wc.db file which is an sql lite file.
  2. Open it with an sql client, e.g. DBeaver. Add an sql lite connection to the dbeaver by selecting the wc.db file.
  3. Open the WC_LOCK table. You can see one or more rows that contains the URL which was mentioned in the phantom lock error window.
  4. Delete these rows from the table.
  5. Try to update your project from the repo.
  6. If you use more than 1 repo in 1 project (externals) another phantom lock may appear during the update. In this case repeat the process with that folder.
Moonlighting answered 11/3, 2019 at 0:18 Comment(4)
Please consider editing your question to add some indentation making your steps into a proper list.Phyllis
This is a genius solution...! Thanks a lot, it worked like a charm.Urgency
Thanks! In most cases the UI based solution is enough. But not always. This is the case when you need to go deeper.Define
Great solution, works for me, but on the tabla were no url, there was only one entry with a "1" on the wc_id attribute. I deteled it and can commit without problem, thanks a lot.Overwhelming
T
4

Old question, but none of the above solutions worked for me. What did work was to close eclipse, then using Tortoise, right click on the project in Windows Explorer and choose 'TortoiseSVN' -> 'Clean up', then just use the default checkboxed items (Clean up working copy status, include externals), then hit OK.

This cleaned up the folder, then I was able to update and commit files as normal.

Tango answered 28/4, 2016 at 18:20 Comment(1)
This worked for us. Great answer. This occurs when you commit too many individual files within a small frame of time.Shabbir
C
4

Using SVN 1.8, deleting lock file does not help (lock file does not exists).

Refresh/Cleanup did not solve either.

What did solve:

1) Backup your directory, just incase...
2) Team... Disconnect. Choose to remove .svn files
3) Add it again to SVN.

Note: In my case, error was due to loss of network connection during initial commit.

Colonic answered 11/7, 2016 at 4:24 Comment(2)
More recently, just performing "snv cleanup /path/to/my/project" from the command line saved meColonic
you save me with your comment on your answer. On MacOS I just run "svn cleanup" from terminal in the project folder and solve all the problems without need to disconnect the project! I suggest u to edit your answer by adding this option!Baldheaded
G
2

svn help unlock

And find locker after all - lock isn't needed in most cases

Gallego answered 18/3, 2012 at 6:27 Comment(0)
K
2

I have faced same problem. I solved this by Right click on project --->Team----> Refresh/cleanup

Kt answered 16/12, 2015 at 6:57 Comment(0)
M
1

We don't have an external SVN server. I was working on a PC with Windows 7 Enterprise, and I was using Eclipse subversion plugin as an SVN client. The problem in my case occurred when the commit of a file took to much time due to network problem that forced me to restart my PC.

After the restart I started getting this error: XXX file already locked.

The solution was to install (TortoiseSVN), right click on the SVN project folder --> TortoiseSVN --> cleanup.

I hope that this post would be a help to someone.

Mushro answered 19/3, 2019 at 12:24 Comment(0)
N
1

use tortoise svn to cleanup with 'break write locks' option checked

Newt answered 9/4, 2020 at 11:55 Comment(0)
B
0

I tried recursively deleting all lock files, but that just resulted the error "Path is not a working copy". I ended up having to do Team->Disconnect and then Team->Share. Upon reconnect, it complained about existing .svn files, which it deleted. Now it seems to be working.

Boarder answered 6/11, 2013 at 14:55 Comment(0)
P
0

I spent hours looking for a solution to the "Attempted to lock an already-locked dir" error I was receiving in IBM RAD. Finally, I guessed to type:

unlock <directory path>

in the RAD console and... volia I could finally syncronize my files!!

Purse answered 17/4, 2014 at 9:51 Comment(0)
K
0

Go to the metadata directory as below

your workspace>projectname>.metadata

inside this metada directory, there will be a lock file. Delete this lock file.

Restart eclipse and rebuild project. It worked for me !

Karylkarylin answered 22/4, 2019 at 8:9 Comment(0)
P
0

Subversion supports a command named "Cleanup"; it is used to release the locks on a projectenter image description here

Photic answered 7/6, 2019 at 6:47 Comment(0)
M
0

I solved a similar problem. SVN client gave me an error:

"svn: E200002: Failed to create new lock."

I tried everything including "Cleanup" and "Still Lock" but with no success. Then I solved the problem simply, I went to my svn server and deleted the locks folder:

at "c:/svn/my_repository/locks"

It turned out that there are broken files in it.

Miscarry answered 14/1, 2020 at 8:45 Comment(0)
R
0

Refresh/Cleanup did not work for me. What worked:

1) File -> Switch workspace - choose a different workspace
2) afterwards switch back to the original workspace
Runlet answered 4/8, 2020 at 12:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.