Java News Tips Software
Java News Tips Software | Contact | Facebook | Twitter RSS

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/
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/
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.

Labels: , ,


  1. Anonymous Anonymous on July 09, 2009 7:55 AM  
    Thanks, its working. saved lot of my time.
  2. Anonymous Anonymous on August 01, 2009 1:58 AM  
    Thank you :)
  3. Anonymous Anonymous on August 21, 2009 11:10 PM  
    Thanks for the solution! Really appreciate it!
  4. Anonymous Anonymous on October 14, 2009 10:01 PM  
    This was very annoying, your suggestion worked for me so many thanks!
  5. Anonymous Anonymous on October 20, 2009 12:05 AM  
    Thank you
  6. Thanks a lot. Its working.
  7. Anonymous Anonymous on November 16, 2009 9:18 AM  
    At first CleanUp worked, but now clean up is also not working. Any other solutions?
  8. Anonymous Anonymous on November 18, 2009 3:53 PM  
    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
  9. Awesome, thanks alot.It works.
  10. Anonymous Anonymous on January 29, 2010 7:20 PM  
    Thanks - works a treat.
  11. Anonymous Anonymous on February 10, 2010 4:14 PM  
    It worked like a charm! Ty :)
  12. Anonymous Anonymous on March 03, 2010 3:47 PM  
    Thank you,
  13. Anonymous Anonymous on March 21, 2010 11:40 PM  
    Excellent help. It saved me a lot of time.
  14. Anonymous Anonymous on April 08, 2010 10:11 PM  
    Thanks a lot :)
  15. Anonymous Anonymous on May 05, 2010 4:22 AM  
    Thank you! This solved my problem :)
  16. Anonymous Anonymous on May 12, 2010 2:51 AM  
  17. Anonymous Anonymous on May 20, 2010 10:03 AM  
    Thanks much
  18. Anonymous Mohamed Ennahdi El Idrissi on June 02, 2010 6:15 PM  
    Thank you for these tips, they are very handy!
  19. Anonymous Anonymous on June 06, 2010 11:15 AM  
    Thank you so much!
  20. Anonymous Anonymous on June 22, 2010 12:09 PM  
    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.
  21. Thanks a lot buddy
  22. Anonymous Anonymous on July 19, 2010 11:17 PM  
    Thanks. Very helpful.
  23. // #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.
  24. Anonymous Anonymous on August 13, 2010 1:08 AM  
    Gracias por el POST en el blog, me ahorro gran tiempo y pude solucionarlo.

  25. Anonymous Anonymous on August 13, 2010 6:07 AM  

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

  26. Anonymous Anonymous on October 08, 2010 8:32 PM  
  27. Anonymous Anonymous on October 11, 2010 6:09 PM  
    Thanks a lot :)
  28. Anonymous Anonymous on November 01, 2010 8:40 PM  
    Didn't work for me :(
  29. Anonymous Anonymous on November 22, 2010 6:34 AM  
    This comment has been removed by a blog administrator.
  30. Anonymous Anonymous on November 22, 2010 8:18 PM  
    Works! Thanks!
  31. Anonymous Anonymous on December 06, 2010 7:28 PM  
    Works for my, Thanks !!!
  32. It`s works!
  33. You're awesome
  34. Anonymous Rich MacDonald on January 04, 2011 2:45 AM  
    Thank you.
  35. Anonymous Anonymous on January 10, 2011 10:09 PM  
    I don't have the cleanup option in eclipse. but I found that deleting a file called lock fixed the problem
  36. 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.

  37. thanks a lot, its working great
  38. 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.
  39. Anonymous Anonymous on March 11, 2011 1:20 PM  
    Thanks a bunch. Saved a lot of my time !!!
  40. Anonymous Anonymous on March 23, 2011 1:35 PM  
    Thanks a lot, cleaning up was what I needed!
  41. Anonymous Anonymous on March 29, 2011 2:30 AM  
    Thanks a lot lot lot lot....It saved my time...
  42. Thank You
  43. Anonymous sajid habib on April 05, 2011 3:06 PM  
    Many thanks, worked for me too! Grateful to you!
  44. Anonymous Anonymous on April 12, 2011 10:27 PM  
    Thank You
  45. Anonymous Anonymous on May 04, 2011 2:13 PM  
    it worked for me.
    u saved my day.
    thx alot.
  46. Anonymous Anonymous on May 18, 2011 4:01 AM  
  47. Thank you :-)
  48. thank you really straight forward :)))
  49. Anonymous Anonymous on January 14, 2012 2:22 AM  
    It was helpful thanks
  50. Thank you very much.
  51. worked like a charm!
  52. Anonymous Anonymous on March 28, 2012 1:21 AM  
    Thanks a lot
  53. Excellent! Thanks!
  54. Excellent.! It Worked... Thank you very much...
  55. eExcellent.! It Worked... Thank you very much...
  56. 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.
  57. Anonymous Anonymous on July 26, 2012 1:53 PM  
    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.
  58. Worked perfectly. Drove me crazy. Thanks so much!
  59. 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!
  60. This comment has been removed by a blog administrator.
  61. Anonymous Anonymous on October 15, 2013 2:04 PM  
    Really very gud answer and it saved my time as I was putting up lot of effort for resolving it.
  62. Anonymous Anonymous on March 03, 2014 6:58 AM  
    This comment has been removed by a blog administrator.
  63. Anonymous Nawazish on April 15, 2014 11:00 AM  
    on clean up:
    it further shows an error:
    SVN clean up has encountered a problem.
    org.tigris.subversion.javahl.ClientException: Path is not a working copy directory

    any idea about this ?
  64. Thank you so much.
    This helps me a lot!
Page Views :
Email :
Select Month:
Free counter and web stats