SVN "Already Locked Error"

138,512

Solution 1

After discussing with the hosting of my SVN repository they gave me the following answer.

Apparently my repository is replicated to a remote repository using SVNSYNC. SVNSYNC has known limitations with enforcing locking across the replicated repositories and this is where the problem lies.

The locks were introduced by the AnkhSVN plugin in Visual Studio.

As the locks appears to be on the remote repository this explains why I can't actually see them using SVN commands.

The locks are being removed via the hosting company and hopefully all will soon be well again.

Solution 2

If your SVN repository is locked by AnkhSVN, just use "cleanup" command from AnkhSVN to release the lock! ;)

Solution 3

I had the same problem. This problem is easily solved if you issue the Cleanup command from AnkhSVN.

Solution 4

These settings worked for me:

Screenshot

I was unable to update repository after the connection timeout, while I was checking out the repository.

Solution 5

I am not using AnkhSVN but got a similar problem after cancelling a Tortoise SVN update. It left two directories "already locked". Similar to Roman C's solution. Use Get lock to to lock one file in each directory that is "already locked" and then release those locks, then do a cleanup on the highest directory. That seemed to fix the problem.

Share:
138,512
BENBUN Coder
Author by

BENBUN Coder

Just developing for fun.

Updated on July 21, 2022

Comments

  • BENBUN Coder
    BENBUN Coder almost 2 years

    When trying to commit a change to a repository ( where I am the only user ) I get an error

    Path
    '/trunk/TemplatesLibrary/constraints/templates/TP145210GB01_PersonWithOrganizationUniversal.cs'
    is already locked by user 'admin' in filesystem
    '/guest/gam/subversion/cdaapi/db'
    

    I am the user 'admin'.

    I have tried the following, all without success

    • running a "clean up" from Tortoise SVN
    • checking out a new copy
    • using the "repo browser" to break locks, but no locks are shown ( as per SVN file locked by me, now cannot commit it )

      I am completely stuck now as I have a repository now that I can not commit any updates to.

      Any ideas how I fix this

      More Info, as requested :

      SVN Status command yields ( I have made edits to one file )

              92       77 admin        TP146228GB01_EncompassingEncounter.cs
              92       83 admin        TP145212GB02_WorkgroupUniversal.cs
              92       83 admin        TP146248GB01_ReferenceURL.cs
              92       85 admin        TP145201GB01_PatientUniversal.cs
              92       83 admin        TP145204GB02_RecipientWorkgroupUniversal.cs
              92       83 admin        TP145202GB01_RecipientPersonUniversal.cs
              92       83 admin        TP145203GB02_RecipientOrganizationUniversal.cs
              92       77 admin        TP145205GB01_PersonUniversal.cs
              92       83 admin        TP145202GB02_RecipientPersonUniversal.cs
              92       83 admin        TP145203GB03_RecipientOrganizationUniversal.cs
              92       85 admin        TP145211GB01_HealthCareFacilityUniversal.cs
              92       85 admin        TP145200GB01_AuthorPersonUniversal.cs
              92       83 admin        TP145207GB01_AuthorDeviceUniversal.cs
          M   92       87 admin        TP146226GB02_Consent.cs
              92       85 admin        TP146229GB01_TextSection.cs
              92       83 admin        TP145204GB03_RecipientWorkgroupUniversal.cs
              92       86 admin        TP145018UK03_CustodianOrganizationUniversal.cs
              92       83 admin        TP145208GB01_AuthorNonNamedPersonUniversal.cs
              92       70 admin        TP145214GB01_DocumentParticipantUniversal.cs
              92       85 admin        TP145007UK03_RelatedEntity.cs
              92       80 admin        TP146224GB02_Atachment.cs
              92       83 admin        TP146227GB02_ServiceEvent.cs
              92       77 admin        TP145210GB01_PersonWithOrganizationUniversal.cs
      

    A svn commit then yields

    svn commit --message updates
    Sending        TP146226GB02_Consent.cs
    Transmitting file data .svn: E195022: Commit failed (details follow):
    svn: E195022: File    'D:\BENBUN_CODE\WORK\cdaapi\trunk\TemplatesLibrary\constraints\templates\TP146226GB02_Consent.cs' is locked in another working copy
    svn: E170007: No lock on path '/subversion/cdaapi/!svn/wrk/3c75d861-8462-b94e-8729-df54843044f9/trunk/TemplatesLibrary/constraints/templates/TP146226GB02_Consent.cs' (Status 423 on PUT Request)
    svn: E175002: Server sent unexpected return value (423 Locked) in response to PUT request for '/subversion/cdaapi/!svn/wrk/3c75d861-8462-b94e-8729-df54843044f9/trunk/TemplatesLibrary/constraints/templates/TP146226GB02_Consent.cs'  
    

    As requested output of SVN st -u is shown below

    >svn st -u
    M               92   TP146226GB02_Consent.cs
    Status against revision:     92              
    
  • Fattie
    Fattie over 10 years
    Amazingly helpful - thanks! Same deal on Versions.app for Mac. MERRY CHRISTMAS!!!
  • JBA
    JBA over 10 years
    Worked perfectly fine for me, aquired lock by 'get lock', got the error again, runned a clean up on the root directory and got rid of it.
  • Manish Mudgal
    Manish Mudgal about 10 years
    I was trying to check in a folder inside the root folder.. You have to perform cleanup on root folder.
  • Cameron
    Cameron almost 9 years
    Same here, I had the lock error after cancelling a TortoiseSVN update. For me, doing a 'Clean up' from TortoiseSVN fixed the problem (svn cleanup from the command line wasn't enough).