TeamCity database corruption

We are using TeamCity 5.1.2 and it appears our external MySQL server's local hard disk was filled corrupting our database. Other than restoring a backup, is there any way to fix the database?

We are getting this error:
Can not run build: SQL error when doing: Executing  with parameters: [11781] caused SQL error:
SQL query: SELECT bs.ID FROM build_state bs LEFT JOIN build_queue q ON q.BUILD_STATE_ID = bs.ID LEFT JOIN history h ON h.BUILD_STATE_ID = bs.ID LEFT JOIN running r ON r.BUILD_STATE_ID = bs.ID WHERE (q.BUILD_STATE_ID IS NOT NULL OR h.BUILD_ID IS NOT NULL OR r.BUILD_ID IS NOT NULL) AND bs.ID = ?
SQL exception: Table './util_teamcity/build_queue' is marked as crashed and should be repaired

Any help would be greatly appreciated.

-Dave

4 comments
Comment actions Permalink

Truncating the build_queue table seemed to fix the problem.


0
Comment actions Permalink

We've been having some strange issues lately. For example the TeamCity groups stopped working and I had to assign user roles to all TeamCity users. Is there a way to check the TeamCity database integrity?

0
Comment actions Permalink

I do not remember any bugs like this, so not sure what can it be. Anyway I would suggest to install latest TeamCity 5.1 version (if you do not yet plan to upgrade to 6.0). You can download previous releases from this page: http://confluence.jetbrains.net/display/TW/Previous+Releases+Downloads

As for integrity check, we do not have one built into TeamCity. Maybe it would be safer for you to dump MySQL database and restore it. This will eliminate problems with corrupted tables.

0
Comment actions Permalink

I just upgraded to TeamCity 6.0.1 minutes ago. So, we'll see what happens now.

I didn't dump the database and restore it. But I will if I experience any further database-related problems.

Thanks,
-Dave

0

Please sign in to leave a comment.