Friday, 26 August 2011

Subversion: Attempted to lock an already-locked dir

Earlier today I was committing some changes to a local Subversion repository running on a PC when Windows decided it was too busy to co-operate and told me that it was “Not Responding” (which is not unusual). Spring's STS program (aka eclipse painted green) running on my handy-dandy Mac hung and then crashed (v. unusual) leaving the commit half complete.

On restarting STS, I again attempted to commit my work and got this error:
org.tigris.subversion.javahl.ClientException: Attempted to lock an already-locked dir
svn: Working copy ‘YOUR PATH GOES HERE’ locked
org.tigris.subversion.javahl.ClientException: Attempted to lock an already-locked dir
svn: Working copy ‘YOUR PATH GOES HERE’ locked
Fortunately, although the error message may appear baffling, it’s very easy to fix. In STS or eclipse, right click on the offending project, click Team and then select Cleanup. SVN jumps into action and the problem is quickly sorted as the offending .lock files are deleted.

You can also do this from the command line, but this method is much simpler.

3 comments:

Ilias Tsagklis said...

Hi Roger,

Nice blog! Is there an email address I can contact you in private?

Roger Hughes said...

Thanks for your comment. You can contact me using [email protected]

Anonymous said...

Hi Roger,

This was very helpful for me.

Thank you very much