msgbartop
Various ramblings-on, mostly about Red5
msgbarbottom

03 Sep 08 Fun with svnsync and googlecode

Today we (Red5) moved our cvsdude repository to our existing google code repository. One of the first steps to take care of is to remove anything in your google code repository and have it reset to revision 0. To get the reset, you have to post to the google code discussion group and request it. If your repository is already empty you may see the option to reset under your projects “Source” tab.

Before you start your sync I suggest that you perform an svn update, svn commit, and svn clean up on your source repository; in that order.

Step 1: Open a terminal or command window and issue this command from top level directory of your checkout location
svnsync init --username yourusername https://myproject.googlecode.com/svn/ https://svn1.cvsdude.com/myproject

The username is for your destination which is the first url specified, the next url is for the source. You may be presented with a password prompt and / or a key accept dialog, answer and proceed

Step 2: Issue the sync command, which will be used every time you need to restart the sync
svnsync sync https://myproject.googlecode.com/svn

The url should point to your destination.

If everything goes smoothly, you will not see any errors and your repository will exist on the destination. This was not the case for us, so here are the ways we got past the issues that resulted.

Errors that you may simply restart from:

svnsync: REPORT request failed on 'https://svn1.cvsdude.com/myproject'
svnsync: REPORT of 'https://svn1.cvsdude.com/myproject': 200 OK (https://svn1.cvsdude.com)


svnsync: PROPFIND request failed on '/svn/!svn/vcc/default'
svnsync: PROPFIND of '/svn/!svn/vcc/default': 502 Bad Gateway (https://myproject.googlecode.com)


svnsync: MERGE request failed on '/svn'
svnsync: MERGE of '/svn': 502 Bad Gateway (https://myproject.googlecode.com)


svnsync: DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent
svnsync: At least one property change failed; repository is unchanged

Errors that require more a bit more work:


svnsync: Destination HEAD (99) is not the last merged revision (89); have you committed to the destination without using svnsync?

To fix this you should open your project in a browser and proceed to the “Source” tab and then select “Changes”, note the latest revision and it should match the one displayed in the error which is 89 in this case. You will need to issue this command:


svn propset --revprop -r0 svn:sync-last-merged-rev 99 https://myproject.googlecode.com/svn

Some docs on the web say to use “revision” instead of “rev” but you can verify which one to use by issueing this command:

svn proplist --revprop -r 0 https://myproject.googlecode.com/svn

Which will output this:

Unversioned properties on revision 0:
svn:sync-from-uuid
svn:sync-last-merged-rev
svn:date
svn:sync-from-url

If another process locked up or is stuck in some way, you may see this error when issuing a command:

Failed to get lock on destination repos, currently held by 'COMPUTERNAME:e2e42f6b-6743-0241-9db7-0f85024665b6'

Kill any svnsync processes or cmd.exe processes to clear it.

If you seem to be caught in a loop where setting the revision doesn’t let you continue, you should remove the currently-copying property like so:

svn pdel --revprop -r 0 svn:sync-currently-copying https://myproject.googlecode.com/svn

Use this with caution and only do it if you are sure that the revision that you are setting has been commited.


Another command that may be needed is “copy-revprops” which will manually copy a particular revision. Issue this command:

svnsync copy-revprops https://myproject.googlecode.com/svn 54

You may see this error which means you need to set the last merged revision

svnsync: Cannot copy revprops for a revision that has not been synchronized yet

If its successful you will see this message

Copied properties for revision 54.

New problem:
So I ran into another contdision that wasn’t covered. Here what happened after a typical restart of the sync:


svnsync sync https://myproject.googlecode.com/svn/
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
Failed to get lock on destination repos, currently held by 'COMPUTERNAME:2c4243d7-ad4f-aa40-93fb-5ccc282c2b57'
svnsync: Couldn't get lock on destination repos after 10 attempts

So I issued this:

svn proplist --revprop -r 0 https://myproject.googlecode.com/svn

The response was:

Unversioned properties on revision 0:
svn:sync-from-uuid
svn:sync-lock
svn:sync-currently-copying
svn:sync-last-merged-rev
svn:date
svn:sync-from-url

So I deleted the lock and was able to continue with the sync

svn pdel --revprop -r 0 svn:sync-lock https://myproject.googlecode.com/svn property 'svn:sync-lock' deleted from repository revision 0

I hope you find this information useful, since I had to go around looking for it :)

Urls have changed to protect from any inadvertant modifications.

Tags: , , ,



Reader's Comments

  1. |

    [...] http://gregoire.org/2008/09/03/fun-with-svnsync-and-googlecode/ [...]

  2. |

    Do you use svnmerge? Google runs a bit outdated svn version (http://code.google.com/support/bin/answer.py?answer=56665&topic=10386), but current svn 1.5 can do merges without external tools

  3. |

    Using svnsync to migrate a remote svn repository…

    How to use svnsync to move a remote repository…….

  4. |

    [...] The following links helped me a lot to figure my way around the replication, migration and debugging issues around it. http://dynamicproxy.livejournal.com/58569.html http://stackoverflow.com/questions/2219455/subversion-is-there-anything-faster-than-svnsync http://serverfault.com/questions/175437/subversion-cant-move-permission-denied http://gregoire.org/2008/09/03/fun-with-svnsync-and-googlecode/ [...]

  5. |

    Thanks for the info; really helpful. I had the ‘Failed to get lock on destination repos’ problem and solved it using this post.

  6. |

    Thanks, This article saved my life!

  7. |

    Found 200 OK error as I didn’t give permission in my svn-acl file. After correcting the permission, it copied just 2 revisions and then again got hanged. On clicking ctrl+c, it again showed the same error.

    Don’t know what’s going on…

  8. |

    It’d be great if you could fix the linewrapping on your example commands. Right now they’re simply truncated as soon as they go off the right side of your text area (into the adverts and graphics on the right). I’ve been hunting everywhere for working examples of how to fix a particular SVN problem, your page is the only one I’ve found, and the longer command lines are all chopped off. :-)

    In nay case, thanks for posting the help!



Leave a Comment


Fatal error: Call to undefined function akismet_counter() in C:\xampp\htdocs\paulgregoireblog\wp-content\themes\googlechrome\footer.php on line 9