Attempted to lock an already-locked dir: Subversion issue - Digizol6

Post Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

Wednesday, July 8, 2009

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.

61 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. Thank you! This solved my problem :)

    ReplyDelete
  11. Mohamed Ennahdi El IdrissiJune 2, 2010 at 5:45 AM

    Thank you for these tips, they are very handy!

    ReplyDelete
  12. Thank you so much!

    ReplyDelete
  13. 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
  14. Thanks. Very helpful.

    ReplyDelete
  15. // #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
  16. Gracias por el POST en el blog, me ahorro gran tiempo y pude solucionarlo.

    Saludos

    ReplyDelete
  17. Hi,

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

    Christopher

    ReplyDelete
  18. Didn't work for me :(

    ReplyDelete
  19. Works for my, Thanks !!!

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

    ReplyDelete
  21. 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
  22. thanks a lot, its working great

    ReplyDelete
  23. 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
  24. Thanks a bunch. Saved a lot of my time !!!

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

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

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

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

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

    ReplyDelete
  30. It was helpful thanks

    ReplyDelete
  31. worked like a charm!

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

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

    ReplyDelete
  34. 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
  35. 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
  36. Worked perfectly. Drove me crazy. Thanks so much!

    ReplyDelete
  37. 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
  38. Really very gud answer and it saved my time as I was putting up lot of effort for resolving it.

    ReplyDelete
  39. 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
  40. Thank you so much.
    This helps me a lot!

    ReplyDelete

Post Top Ad

Responsive Ads Here