BuildId got decremented, now all new builds get a "build is outdated" warn

I had to restart our linux server running TeamCity 2.1.1 (we're looking at upgrading, but not right now), and when TeamCity came up, it seems as if the internal buildId numbering counter has been corrupted. When checking older builds under .BuildServer/system/artifacts/ the buildId numbers are at 12000, but the builds since the reboot are now at 2000, which causes a bunch of strange behaviours:

- First of all, every build builds with a warning icon, stating that "This build is outdated. Click the icon to check the newer build results".
- Upon build completion, the latest builds end up at the end of the build history, which means that I need to "view all history records" to see the latest build.

The build history seems to sort builds only depending on buildId, it doesn't seem to matter that both the build number and the build date are newer.

So the obvious question is; is there a way of manually setting the internal buildId value counter, so that we can change it back to 12000+, thus fixing the problem with new builds ending up at the back of the build history?

Regards,
David Ahlard

6 comments

Looks strange. What database do you use?

--
Pavel Sher

0

You need to shutdown server and then execute the following command:

java -jar /WEB-INF/lib/hsqldb.jar --inlineRc "url=jdbc:hsqldb:file:/system/buildserver,user=SA,password=" --sql "SELECT BUILD_ID FROM SERVER;" This command will display current build_id counter. To change the counter modify command to invoke the following SQL statement: UPDATE SERVER SET BUILD_ID = ]]>

--
Pavel Sher

0

Hi Pavel, thanks. But it seems as if the SERVER table is empty.

I tried selecting BUILD_ID from the SERVER table, and it's empty. (0 rows), which maybe is a little unsettling? And if I want to insert a row into the SERVER table, do I also need to set values for "PROJECT_ID", "SERVER_ID" and "BUILD_TYPE_ID"?

0

Well, actually we do not have SQL statements in our system deleting rows from the SERVER table. This may indicate that database is in the inconsistent state. You can insert row with BUILD_ID only since other columns are deprecated and are not used anymore. But after that I would suggest you to migrate to more reliable database like MySQL.

--
Pavel Sher

0

Ok, thanks, I'll give it a try as soon as I can. Come to think of it we did have some problem with our Agents not picking builds from the build queue just before this happened, until we manually forced a cleanup of the build history, so it's quite possible our database has been corrupted somehow.

And yeah, switching to MySQL is in the pipeline, (and upgrading TeamCity at the same time)

But thanks for now!

0

Please sign in to leave a comment.