Search This Blog

26 December 2008

Failed to get lock on destination repos, currently held by....

Recently, one of our work servers has been undergoing some hardware maintenance. I believe it was powered down during one of its svn mirror syncronizations.

The output from the log file showed this:
(sasvn-cm1)[csvn] cron> pwd
/opt/CollabNet_Subversion/cron
(sasvn-cm1)[csvn] cron> cat pipeline-mirror.out
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
svnsync: Couldn't get lock on destination repos after 10 attempts

So, looking around, it appeared that there was a lock on revision 0 but it took awhile to figure out how to remove it...

(sasvn-cm1)[csvn] cron> svn proplist -r 0 --revprop file:///repos/svn/pipeline-mirror
Unversioned properties on revision 0:
  svn:sync-from-uuid
  svn:sync-lock
  svn:sync-last-merged-rev
  svn:date
  svn:sync-from-url

(sasvn-cm1)[csvn] cron> svn propdel -r 0 --revprop file:///repos/svn/pipeline-mirror

Waiting for the next cron cycle to see if it will update, but it looks promising.

26 comments:

  1. I just fixed the same problem like this:
    svn pdel --revprop -r 0 svn:sync-lock file:///var/SP/data/svn/svnmirror2/

    ReplyDelete
  2. Thank you, great timesaver. :-)

    ReplyDelete
  3. Thanks for the info it really saved a lot of time. As an FYI, I wasn't exactly sure where the file references were pointing to in the 2 examples. It's probably obvious and I just need more coffee. Specifically I didn't know if the file was the root Subversion repository folder, or if it was some folder that had been checked out. I assumed it was the root svn repository folder, but that didn't work for me. I got it to work by using M. Darwin's format by with my mirror's URL "svn://mymirror.mycompany.com:48000".

    In other words:
    svn pdel --revprop -r 0 svn:sync-lock svn://mymirror.mycompany.com:48000

    ReplyDelete
  4. Ah yeah. The file:// ones are used if you are referencing the actual datastore location on the server itself.

    ReplyDelete
  5. Thanks for the post!

    ReplyDelete
  6. Hi all,

    There is an explanation of this in the Subversion book (http://svnbook.red-bean.com/en/1.5/svn.reposadmin.maint.html#svn.reposadmin.maint.tk.svnsync) in the sidebar "svnsync Bookkeeping".

    ReplyDelete
  7. Thanks a ton it was a real time saver

    "svn pdel --revprop -r 0 svn:sync-lock repo2"

    ReplyDelete
  8. Thanks for the info, but once I entered svn propdel -r 0 --revprop file:///repos/svn, and then attempted to sync again, I get the same error. What am I doing wrong here?

    ReplyDelete
  9. is /repos/svn where your repo is?

    ReplyDelete
  10. This is what I do..

    svn propdel --revprop -r0 svn:synclock file:///repos/yacc
    property 'svn:synclock' deleted from repository revision 0

    then run;

    svnsync synchronize --username root svn+ssh://root@destination/repos/yacc
    root@destination's password:
    Failed to get lock on destination repos, currently held by 'my.repo.com:e4ad5153-d7ba-4543-b5a0-411798d67b8a'
    Failed to get lock on destination repos, currently held by 'my.repo.com:e4ad5153-d7ba-4543-b5a0-411798d67b8a'
    Failed to get lock on destination repos, currently held by 'my.repo.com:e4ad5153-d7ba-4543-b5a0-411798d67b8a'
    Failed to get lock on destination repos, currently held by 'my.repo.com:e4ad5153-d7ba-4543-b5a0-411798d67b8a'
    svnsync: Caught signal

    ReplyDelete
  11. Can you show the proplist before and after?

    ReplyDelete
  12. I apologize as I am not that much familiar with svn as I enter

    svn proplist
    svn: '.' is not a working copy


    I was in the middle of Setting up a subversion mirror repository using svnsync and temporarily lost connectivity to the mirrored server and that's when all went to hell from there...

    ReplyDelete
  13. can you show me svn proplist -r 0 --revprop file:///repos/yacc

    ReplyDelete
  14. svn proplist -r 0 --revprop file:///repos/yacc
    Unversioned properties on revision 0:
    svn:date

    ReplyDelete
  15. svn:sync-lock is the one that should be preventing this... and it isn't there...?

    ReplyDelete
  16. hmmm... interesting any ideas on what I can do?

    ReplyDelete
  17. Malachi,

    Any idea as to how I can clear the lock as I can't seem to figure it out. I've checked some other forums, which on indicate to do the following;

    # svn propdel svn:sync-lock --revprop -r 0 svn://{destination repository}/opt/svn/{repo}
    # /usr/bin/svnsync --non-interactive synchronize svn://{destination repository}/opt/svn/{repo}

    Read more: http://www.how2centos.com/subversion-failed-to-get-lock-on-destination-repository/#ixzz2HxK1DmRq


    but didn't seem to fix my issue.

    ReplyDelete
  18. Sorry, I don't. When you listed the properties, it wasn't on the list... so not really sure what is going on.

    ReplyDelete
  19. Great post! It worked for me :) THANK YOU

    ReplyDelete
  20. ATTENTION! I have a similar problem and there was no explanation on the Internet! If you have a problem with the lock, you delete it, have a confirmation, and it still is in rev 0, you have either permission issues and should del the prop from the server, or you are out of free space on the disk. Then svn deletes the lock successfully, gives a confirmation, but can't save the edited file. BUG!

    ReplyDelete