Error collecting changes for VCS root

I get this error sometimes in the project list (white text on red, "Problems with VCS connection   (view details)")
The details shows:

Error collecting changes for VCS root 'svn: file:///repositories/TestProject/trunk' #6
org.springframework.jdbc.UncategorizedSQLException: Error executing query with params:[1079, test user, some comment, 1254307712117, 6, 1, 620_2009/09/30 13:48:33 +0300, 620, 9]; uncategorized SQLException for SQL [INSERT INTO vcs_history (MODIFICATION_ID, USER_NAME, DESCRIPTION, CHANGE_DATE, VCS_ROOT_ID, VCS_ROOT_VERSION, VERSION, DISPLAY_VERSION, CHANGES_COUNT) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [23000]; error code [1062]; Duplicate entry '1079' for key 1; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1079' for key 1

This goes away after a while and the build is ok.

I don't know if this is related, but all the entries in eg. the change log are duplicated:

18 Sep 09 10:22 layout test user 4 files svn:                          606
18 Sep 09 10:22 layout test user 4 files svn:                          606
08 Sep 09 21:42 barcode reader integration test user 8 files svn:                          589
08 Sep 09 21:42 barcode reader integration test user 8 files

svn:                          589


I'm using TeamCity 4.5.4 (build 9071)

0
33 comments

I tried to reproduce this problem using your server.xml file but wihout success. How do you check that there is more than one instance of TeamCity running? Have you tried to access all of them by URL? If one of them is accessible by localhost probably you need to check <Host/> configuration for localhost.

Is there a chance that another TeamCity server is running on different PC? If you are using MySQL you can check the host from which the connections are opened, use command:
show processlist

0
Avatar
Permanently deleted user

Pavel, thank you very much for your help! We digged in logs and configs and found out the reason of our problem. Problem was here:

<Host name="teamcity.in.devexperts.com">
    <Context path="" docBase="${catalina.home}/virtual" debug="5"/>
</Host>
We didn't put param appBase in <Host> - so when we started server it looked in all folders of teamcity for WEB-INF and started it. And then one more instance started according to <Context path="" docBase="${catalina.home}/virtual" debug="5"/>.So the fix is this one:

<Host name="teamcity.in.devexperts.com" appBase="bin">
    <Context path="" docBase="${catalina.home}/virtual" debug="5"/>
</Host>

We set appBase with fake path and now only one instance starts.

It seems we don't have this problem with MySQL any more. And problem with duplicate changes also disappeared.

0

Nice, thank you for your feedback, this will help us to solve similar problems for other users!
Anyway, to address this problem TeamCity 5.0 will detect presence of another TeamCity instance working with the same database and won't initialize if such instance found. Hope this will eliminate a lot of pain in the future.

0

Please sign in to leave a comment.