Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svnsync - couldn't get lock on destination repos

Tags:

svn

svnsync

Using svnsync

$ svnsync --non-interactive sync ${REPO}

after an abort of the process there was this error message with retry

Failed to get lock on destination repos, currently held by 'svn.test.com:0e4e0d98-631d-0410-9a00-9330a90920b3'  
...  
Failed to get lock on destination repos, currently held by 'svn.test.com:0e4e0d98-631d-0410-9a00-9330a90920b3'   
svnsync: Couldn't get lock on destination repos after 10 attempts  

Is there a way to fix this problem?

like image 489
sdu Avatar asked Nov 02 '10 12:11

sdu


3 Answers

Actually, there is some functionality built into svnsync (since v1.7) that can "steal" the lock.

svnsync help sync

shows:

--steal-lock             : Steal locks as necessary.  Use, with caution,
                           if your mirror repository contains stale locks
                           and is not being concurrently accessed by another
                           svnsync instance.

and when I run it, I get a nice:

Stole lock previously held by '[hostname]'

So, you don't need the propdel thing after all

like image 117
s3v1 Avatar answered Nov 07 '22 20:11

s3v1


You have to remove the lock property on the remote repository via svn command line on the remote site which has been left over from a failure during synchronization.

svn propdel --revprop -r0 svn:sync-lock file:///path/to/the/repository
like image 27
khmarbaise Avatar answered Nov 07 '22 18:11

khmarbaise


Technically, it is the destination repository that you need to delete the property from, not necessarily the remote repository, as the destination could be local. So for this specific question:

svn propdel --revprop -r0 svn:sync-lock ${REPO}
like image 11
Matt White Avatar answered Nov 07 '22 19:11

Matt White