Urgent: SVN repo rollback leaves TC stuck

Hi,
We had to do a recovery of one svn repository last night, and a few revisions at the end of the evening were lost.  Now, even when I clean sources on a build, it tells me

org.tmatesoft.svn.core.SVNException: svn: No such revision 83565


What do I need to do to fix it?  Do I have to drop and rebuild all the build configurations?  Does it go so far as my having to wipe out the projects and svn repo entry and rebuild all of it?

Thanks very much for any advice you can give me with this.

8 comments
Comment actions Permalink

Hello Mark,

  I'm sorry for delay with answer.
  First, please stop TeamCity.
  Than, please run the following SQL commands on your database:

delete from build_revisions where VCS_REVISION like '83565\_%';
delete from vcs_history where VERSION like '83565\_%';

and then start TeamCity.

  Hope this helps,
  KIR

0
Comment actions Permalink

That got me most of the way, but one repository is now giving me this error:

org.springframework.jdbc.UncategorizedSQLException:
  Error executing batch ; uncategorized SQLException for SQL [INSERT INTO build_type_vcs_change (MODIFICATION_ID, BUILD_TYPE_ID) VALUES (?, ?)];
SQL state [23000]; error code [1062]; Duplicate entry '12761-bt103' for key 1;
nested exception is java.sql.BatchUpdateException: Duplicate entry '12761-bt103' for key 1

Any help you can give is still greatly appreciated!

0
Comment actions Permalink

Hello Mark,

  Could you please attach full exception from your logs? See TeamCity/logs/teamcity-server.log and TeamCity/logs/teamcity-vcs.log files.

  Regards,
  KIR

0
Comment actions Permalink

Files attached.  Thanks for the quick reply!

Also, I have logged TW-9967 regarding a potential enhancement for TC in this area.



Attachment(s):
vcs.log.zip
server.log.zip
0
Comment actions Permalink

Hello Mark,

  I believe this is safe to run
  delete from build_type_vcs_change where MODIFICATION_ID=12762 and BUILD_TYPE_ID='bt103'

  Regards,
  KIR

0
Comment actions Permalink

That appears to have cleared it... thanks!

0
Comment actions Permalink

Kirill,

We have a similar issue after needing to restore SVN from a backup after a drive failure. We lost about a dozen checkins, and now TeamCity is failing with:

Failed to collect changes, error: Error collecting changes for VCS repository 'trunk' Checkout rule:  Unable to get SVN log entries for: svn://<host>/<repos>/trunk; range: RR[33524_2013/08/09 21:02:49 -0400 => 33503_2013/08/12 11:25:02 -0400]@ee076a99-d419-c942-8f1f-9f2df5017fe8; revisions: 33524..33503

The revision range in the error message is the range of revisions we lost.

We're able to recover all the lost changesets from developers' local workspaces, but I can't get TeamCity to 'reset' it's VCS back to the earlier state.

I've backed up the TC database and tried SQL commands similar to those mentioned in this thread to remove references to the missing revisions, but still the error persists. Is there some other repository of change info that I'd need to fix?

Thanks for any help,

0
Comment actions Permalink

I've just used SVN repository obliterate/purge tool (called Subdivision) and it creates similar effect in Teamcity 10.0.3 because all revisions are shifted and total number of revisions is reduced.

Teamcity is confused despite the fact that UUID was regenerated and server restarted and SVN cache and SVN Externals cache are reset in Diagnostics.

Setting SVN format to 1.6, Test Connection, Save, and then setting back to 1.8 seems to help.

 

0

Please sign in to leave a comment.