Skip to main content

Attempted to lock an already-locked dir: Subversion issue

"Attempted to lock an already-locked dir" - svn: Working copy locked; this message is frequently faced by users of SubVersion (SVN) source repository. The message is self explanatory; simply some source files are locked and no commit or update operations allowed on those files/folders. In some occasions, Software developers in a team receive this message in a SVN operation even though none of them have locked the files or folders; causing confusion. So how would you try and resolve?

We use Subversion to create and store our projects in repositories; Subclipe (an Eclipse plugin) as the client tool to connect to repository.

We tried following solutions

1. Commit Changes - change and commit changes into repository
2. File Delete - delete the files and commit the delete into repository
3. Override & update - override the local changes and update from repository

None of the above options resolved the issue, but got the same type of error messages. Followings are the error messages shown inside Eclipse while trying the above mentioned options.

commit -m C:/workspace/MyProject/config.properties
Attempted to lock an already-locked dir
svn: Working copy 'C:\workspace\MyProject' locked

update -r 13 C:/workspace/MyProject/src
Attempted to lock an already-locked dir
svn: Working copy 'C:\workspace\MyProject' locked

delete --force C:/workspace/MyProject/config.properties
Attempted to lock an already-locked dir
svn: Working copy 'C:\workspace\MyProject' locked

Use Cleanup command

Subversion:Team-CleanupSubversion supports a command named "Cleanup"; it is used to release the locks on a project.

If you have faced with the above issue while no one has locked the project files, you can run this command and resolve the issue.
You do this in Eclipse by right clicking the project; then Team->Cleanup as shown in the image.

Comments

  1. Thanks, its working. saved lot of my time.

    ReplyDelete
  2. Thanks for the solution! Really appreciate it!

    ReplyDelete
  3. This was very annoying, your suggestion worked for me so many thanks!

    ReplyDelete
  4. At first CleanUp worked, but now clean up is also not working. Any other solutions?

    ReplyDelete
  5. And what happens when Cleanup does not work? (Which happens more often than you may imagine). Then you have to disconnect from the svn server, delete all svn files and reconnect. I never had so many problems with CVS as I have with Subversion

    ReplyDelete
  6. Awesome, thanks alot.It works.

    ReplyDelete
  7. Thanks - works a treat.

    ReplyDelete
  8. It worked like a charm! Ty :)

    ReplyDelete
  9. Excellent help. It saved me a lot of time.

    ReplyDelete
  10. Thanks a lot :)

    ReplyDelete
  11. Thank you! This solved my problem :)

    ReplyDelete
  12. Mohamed Ennahdi El IdrissiJune 02, 2010 6:15 PM

    Thank you for these tips, they are very handy!

    ReplyDelete
  13. Thank you so much!

    ReplyDelete
  14. cleanup doesn't work, at least not all the time. just get more of the same messages.

    also deleting the lock files manually doesn't help.

    ReplyDelete
  15. Thanks. Very helpful.

    ReplyDelete
  16. // #7, #8 & #20

    When this does not solve your issue, I would suggest you to try command line svn client and see whether that can help.

    ReplyDelete
  17. Gracias por el POST en el blog, me ahorro gran tiempo y pude solucionarlo.

    Saludos

    ReplyDelete
  18. Hi,

    thank you for this hint. It saved me time and nerves.

    Christopher

    ReplyDelete
  19. Thanks a lot :)

    ReplyDelete
  20. Didn't work for me :(

    ReplyDelete
  21. This comment has been removed by a blog administrator.

    ReplyDelete
  22. Works for my, Thanks !!!

    ReplyDelete
  23. Thank you.

    ReplyDelete
  24. I don't have the cleanup option in eclipse. but I found that deleting a file called lock fixed the problem

    ReplyDelete
  25. If Cleanup doesn't work, then manually the directory above the file and then refresh in workspace and then right-click - replace width - lastest from repository. This worked for me.

    Veducko

    ReplyDelete
  26. thanks a lot, its working great

    ReplyDelete
  27. It works, but not always when you are in Team Synchronize Perspective. Good to know. So if it has no effect, try it directly from your project navigation/development perspective.

    ReplyDelete
  28. Thanks a bunch. Saved a lot of my time !!!

    ReplyDelete
  29. Thanks a lot, cleaning up was what I needed!

    ReplyDelete
  30. Thanks a lot lot lot lot....It saved my time...

    ReplyDelete
  31. Many thanks, worked for me too! Grateful to you!

    ReplyDelete
  32. it worked for me.
    u saved my day.
    thx alot.

    ReplyDelete
  33. thank you really straight forward :)))

    ReplyDelete
  34. It was helpful thanks

    ReplyDelete
  35. Thank you very much.

    ReplyDelete
  36. worked like a charm!

    ReplyDelete
  37. Excellent.! It Worked... Thank you very much...

    ReplyDelete
  38. eExcellent.! It Worked... Thank you very much...

    ReplyDelete
  39. It is not working for me,
    still giving the errors....

    org.apache.subversion.javahl.ClientException: Attempted to write to readonly SQLite db
    svn: sqlite: attempt to write a readonly database
    svn: sqlite: attempt to write a readonly database

    I have tried cleanup through terminal also.

    I am using Fedora-17 and Eclipse-juno.

    ReplyDelete
  40. Although i run svn as a daemon (service) on my server and i access it via the svn+ssh protocol (forcing logging in with an svn user account - user:svn -) with the subclipse plugin of eclipse and Native JavaHL connector, at each commit the folder gets (re)created with credentials of the machine i´m commiting from.
    That is causing this havoc.
    As for now, i didn´t found any solutions - log into server, chown the folder with svn:svn, commit again/cleanup/edit conflicts...??!!!

    And subversioning supposed to make me loose less hair...
    Still looking for the correct settings to overcome this.

    ReplyDelete
  41. Worked perfectly. Drove me crazy. Thanks so much!

    ReplyDelete
  42. There are some interesting points on this article however I don’t know if I see all of them heart to heart. There’s some validity however I will take hold an opinion until I look into it further. Good article , thanks and we want more!

    ReplyDelete
  43. This comment has been removed by a blog administrator.

    ReplyDelete
  44. Really very gud answer and it saved my time as I was putting up lot of effort for resolving it.

    ReplyDelete
  45. This comment has been removed by a blog administrator.

    ReplyDelete
  46. on clean up:
    it further shows an error:
    as
    SVN clean up has encountered a problem.
    org.tigris.subversion.javahl.ClientException: Path is not a working copy directory

    any idea about this ?

    ReplyDelete
  47. Thank you so much.
    This helps me a lot!

    ReplyDelete

Post a Comment

We appreciate your opinions, suggestions and criticism.

Popular posts from this blog

Web Services with Apache Axis 1.4 Tutorial: server and client sides

Java Sorting: Comparator vs Comparable Tutorial

Creative Commons License Digizol by Kamal Mettananda is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License .
URL of this page must be supplied in attribution
© 2004-2017