TeamCity has failed to start

As far as I know I haven't changed anything on the build server and everything looks normal. Per the server log, the database is found.

[2014-06-25 11:14:23,781]   INFO -  jetbrains.buildServer.STARTUP - ===========================================================
[2014-06-25 11:14:23,781]   INFO -  jetbrains.buildServer.STARTUP - Starting TeamCity server
[2014-06-25 11:14:23,940]   INFO -  jetbrains.buildServer.STARTUP - TeamCity version: 8.1.2 (build 29993), data format version 658
[2014-06-25 11:14:23,943]   INFO -  jetbrains.buildServer.STARTUP - OS: Windows 7, JRE: 1.7.0_51-b13 Java HotSpot(TM) Server VM
[2014-06-25 11:14:23,944]   INFO -  jetbrains.buildServer.STARTUP - JVM parameters: -Djava.util.logging.config.file=c:\TeamCity\bin\..\conf\logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xrs -Xmx512m -XX:MaxPermSize=270m -Dlog4j.configuration=file:../conf/teamcity-server-log4j.xml -Dteamcity_logs=../logs/ -Djava.endorsed.dirs=c:\TeamCity\bin\..\endorsed -Dcatalina.base=c:\TeamCity\bin\.. -Dcatalina.home=c:\TeamCity\bin\.. -Djava.io.tmpdir=c:\TeamCity\bin\..\temp
[2014-06-25 11:14:23,944]   INFO -  jetbrains.buildServer.STARTUP - Servlet real path: c:\TeamCity\bin\..\webapps\ROOT\
[2014-06-25 11:14:23,954]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Looking for the TeamCity Data Directory
[2014-06-25 11:14:23,954]   INFO -  jetbrains.buildServer.STARTUP - TeamCity Data Directory path is determined using the environment variable TEAMCITY_DATA_PATH
[2014-06-25 11:14:23,954]   INFO -  jetbrains.buildServer.STARTUP - Data Directory "C:\ProgramData\JetBrains\TeamCity" exists
[2014-06-25 11:14:23,963]   INFO -  jetbrains.buildServer.STARTUP - The main configuration file "C:\ProgramData\JetBrains\TeamCity\config\main-config.xml" exists
[2014-06-25 11:14:23,963]   INFO -  jetbrains.buildServer.STARTUP - The database properties file "C:\ProgramData\JetBrains\TeamCity\config\database.properties" doesn't exist
[2014-06-25 11:14:23,963]   INFO -  jetbrains.buildServer.STARTUP - The internal database data file "C:\ProgramData\JetBrains\TeamCity\system\buildserver.data" exists
[2014-06-25 11:14:24,010]   INFO -  jetbrains.buildServer.STARTUP - Data Directory version: 658
[2014-06-25 11:14:24,010]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Looking for the database configuration
[2014-06-25 11:14:24,010]   INFO -  jetbrains.buildServer.STARTUP - Database properties file "C:\ProgramData\JetBrains\TeamCity\config\database.properties" doesn't exist
[2014-06-25 11:14:24,011]   INFO -  jetbrains.buildServer.STARTUP - Internal HSQL database file (C:\ProgramData\JetBrains\TeamCity\system\buildserver.data) exists, version: 2.2.9
[2014-06-25 11:14:24,011]   INFO -  jetbrains.buildServer.STARTUP - Using internal (HSQL) database
[2014-06-25 11:14:24,011]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Connecting to the database
[2014-06-25 11:14:24,747]   INFO -  jetbrains.buildServer.STARTUP - Current stage: TeamCity server startup error
[2014-06-25 11:14:24,747]   INFO -  jetbrains.buildServer.STARTUP - Administrator can login from web UI using authentication token: 8819801996390229371




      <pre>jetbrains.buildServer.serverSide.db.UnexpectedDBException: Unexpected exception SQLException/HsqlException: SQL error when doing: Taking a connection from the data source
SQL exception: error in script file line: 256 java.io.EOFException in statement [SET TABLE PUBLIC.AGENT INDEX '865976 865976 865976 865976 865976 0 0 0 0 0 1']
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCConnection.&lt;init&gt;(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
    at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDataSource.getConnection(JdbcDataSource.java:52)
    at jetbrains.buildServer.serverSide.db.DBFunctions.create(DBFunctions.java:231)
    at jetbrains.buildServer.serverSide.db.TeamCityDatabaseManager.connect(TeamCityDatabaseManager.java:318)
    at jetbrains.buildServer.maintenance.StartupProcessor.performConnectToDatabaseInternal(StartupProcessor.java:218)
    at jetbrains.buildServer.maintenance.StartupProcessor.performConnectToDatabase(StartupProcessor.java:305)
    at jetbrains.buildServer.maintenance.StartupProcessor.doDatabaseConnect(StartupProcessor.java:425)
    at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStage(StartupProcessor.java:376)
    at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStageSafe(StartupProcessor.java:486)
    at jetbrains.buildServer.maintenance.StartupProcessor.processTeamCityLifecycle(StartupProcessor.java:448)
    at jetbrains.buildServer.maintenance.StartupProcessor.access$000(StartupProcessor.java:450)
    at jetbrains.buildServer.maintenance.StartupProcessor$1.run(StartupProcessor.java:1)
    at java.lang.Thread.run(Thread.java:744)
caused by: java.sql.SQLException: error in script file line: 256 java.io.EOFException in statement [SET TABLE PUBLIC.AGENT INDEX '865976 865976 865976 865976 865976 0 0 0 0 0 1']
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCConnection.&lt;init&gt;(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
    at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDataSource.getConnection(JdbcDataSource.java:52)
    at jetbrains.buildServer.serverSide.db.DBFunctions.create(DBFunctions.java:231)
    at jetbrains.buildServer.serverSide.db.TeamCityDatabaseManager.connect(TeamCityDatabaseManager.java:318)
    at jetbrains.buildServer.maintenance.StartupProcessor.performConnectToDatabaseInternal(StartupProcessor.java:218)
    at jetbrains.buildServer.maintenance.StartupProcessor.performConnectToDatabase(StartupProcessor.java:305)
    at jetbrains.buildServer.maintenance.StartupProcessor.doDatabaseConnect(StartupProcessor.java:425)
    at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStage(StartupProcessor.java:376)
    at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStageSafe(StartupProcessor.java:486)
    at jetbrains.buildServer.maintenance.StartupProcessor.processTeamCityLifecycle(StartupProcessor.java:448)
    at jetbrains.buildServer.maintenance.StartupProcessor.access$000(StartupProcessor.java:450)
    at jetbrains.buildServer.maintenance.StartupProcessor$1.run(StartupProcessor.java:1)
    at java.lang.Thread.run(Thread.java:744)
caused by: org.hsqldb.HsqlException: error in script file line: 256 java.io.EOFException in statement [SET TABLE PUBLIC.AGENT INDEX '865976 865976 865976 865976 865976 0 0 0 0 0 1']
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.scriptio.ScriptReaderText.readDDL(Unknown Source)
    at org.hsqldb.scriptio.ScriptReaderBase.readAll(Unknown Source)
    at org.hsqldb.persist.Log.processScript(Unknown Source)
    at org.hsqldb.persist.Log.open(Unknown Source)
    at org.hsqldb.persist.Logger.openPersistence(Unknown Source)
    at org.hsqldb.Database.reopen(Unknown Source)
    at org.hsqldb.Database.open(Unknown Source)
    at org.hsqldb.DatabaseManager.getDatabase(Unknown Source)
    at org.hsqldb.DatabaseManager.newSession(Unknown Source)
    at org.hsqldb.jdbc.JDBCConnection.&lt;init&gt;(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
    at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDataSource.getConnection(JdbcDataSource.java:52)
    at jetbrains.buildServer.serverSide.db.DBFunctions.create(DBFunctions.java:231)
    at jetbrains.buildServer.serverSide.db.TeamCityDatabaseManager.connect(TeamCityDatabaseManager.java:318)
    at jetbrains.buildServer.maintenance.StartupProcessor.performConnectToDatabaseInternal(StartupProcessor.java:218)
    at jetbrains.buildServer.maintenance.StartupProcessor.performConnectToDatabase(StartupProcessor.java:305)
    at jetbrains.buildServer.maintenance.StartupProcessor.doDatabaseConnect(StartupProcessor.java:425)
    at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStage(StartupProcessor.java:376)
    at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStageSafe(StartupProcessor.java:486)
    at jetbrains.buildServer.maintenance.StartupProcessor.processTeamCityLifecycle(StartupProcessor.java:448)
    at jetbrains.buildServer.maintenance.StartupProcessor.access$000(StartupProcessor.java:450)
    at jetbrains.buildServer.maintenance.StartupProcessor$1.run(StartupProcessor.java:1)
    at java.lang.Thread.run(Thread.java:744)
caused by: org.hsqldb.HsqlException: java.io.EOFException
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.persist.RowStoreAVLDisk.get(Unknown Source)
    at org.hsqldb.persist.DataFileCache.getFromFile(Unknown Source)
    at org.hsqldb.persist.DataFileCache.get(Unknown Source)
    at org.hsqldb.persist.RowStoreAVLDisk.get(Unknown Source)
    at org.hsqldb.persist.RowStoreAVLDisk.setAccessor(Unknown Source)
    at org.hsqldb.Table.setIndexRoots(Unknown Source)
    at org.hsqldb.Table.setIndexRoots(Unknown Source)
    at org.hsqldb.StatementCommand.getResult(Unknown Source)
    at org.hsqldb.StatementCommand.execute(Unknown Source)
    at org.hsqldb.Session.executeCompiledStatement(Unknown Source)
    at org.hsqldb.scriptio.ScriptReaderText.readDDL(Unknown Source)
    at org.hsqldb.scriptio.ScriptReaderBase.readAll(Unknown Source)
    at org.hsqldb.persist.Log.processScript(Unknown Source)
    at org.hsqldb.persist.Log.open(Unknown Source)
    at org.hsqldb.persist.Logger.openPersistence(Unknown Source)
    at org.hsqldb.Database.reopen(Unknown Source)
    at org.hsqldb.Database.open(Unknown Source)
    at org.hsqldb.DatabaseManager.getDatabase(Unknown Source)
    at org.hsqldb.DatabaseManager.newSession(Unknown Source)
    at org.hsqldb.jdbc.JDBCConnection.&lt;init&gt;(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
    at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDataSource.getConnection(JdbcDataSource.java:52)
    at jetbrains.buildServer.serverSide.db.DBFunctions.create(DBFunctions.java:231)
    at jetbrains.buildServer.serverSide.db.TeamCityDatabaseManager.connect(TeamCityDatabaseManager.java:318)
    at jetbrains.buildServer.maintenance.StartupProcessor.performConnectToDatabaseInternal(StartupProcessor.java:218)
    at jetbrains.buildServer.maintenance.StartupProcessor.performConnectToDatabase(StartupProcessor.java:305)
    at jetbrains.buildServer.maintenance.StartupProcessor.doDatabaseConnect(StartupProcessor.java:425)
    at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStage(StartupProcessor.java:376)
    at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStageSafe(StartupProcessor.java:486)
    at jetbrains.buildServer.maintenance.StartupProcessor.processTeamCityLifecycle(StartupProcessor.java:448)
    at jetbrains.buildServer.maintenance.StartupProcessor.access$000(StartupProcessor.java:450)
    at jetbrains.buildServer.maintenance.StartupProcessor$1.run(StartupProcessor.java:1)
    at java.lang.Thread.run(Thread.java:744)
caused by: java.io.EOFException
    at org.hsqldb.lib.HsqlByteArrayInputStream.readInt(Unknown Source)
    at org.hsqldb.index.NodeAVLDisk.&lt;init&gt;(Unknown Source)
    at org.hsqldb.RowAVLDisk.&lt;init&gt;(Unknown Source)
    at org.hsqldb.persist.RowStoreAVLDisk.get(Unknown Source)
    at org.hsqldb.persist.DataFileCache.getFromFile(Unknown Source)
    at org.hsqldb.persist.DataFileCache.get(Unknown Source)
    at org.hsqldb.persist.RowStoreAVLDisk.get(Unknown Source)
    at org.hsqldb.persist.RowStoreAVLDisk.setAccessor(Unknown Source)
    at org.hsqldb.Table.setIndexRoots(Unknown Source)
    at org.hsqldb.Table.setIndexRoots(Unknown Source)
    at org.hsqldb.StatementCommand.getResult(Unknown Source)
    at org.hsqldb.StatementCommand.execute(Unknown Source)
    at org.hsqldb.Session.executeCompiledStatement(Unknown Source)
    at org.hsqldb.scriptio.ScriptReaderText.readDDL(Unknown Source)
    at org.hsqldb.scriptio.ScriptReaderBase.readAll(Unknown Source)
    at org.hsqldb.persist.Log.processScript(Unknown Source)
    at org.hsqldb.persist.Log.open(Unknown Source)
    at org.hsqldb.persist.Logger.openPersistence(Unknown Source)
    at org.hsqldb.Database.reopen(Unknown Source)
    at org.hsqldb.Database.open(Unknown Source)
    at org.hsqldb.DatabaseManager.getDatabase(Unknown Source)
    at org.hsqldb.DatabaseManager.newSession(Unknown Source)
    at org.hsqldb.jdbc.JDBCConnection.&lt;init&gt;(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
    at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDataSource.getConnection(JdbcDataSource.java:52)
    at jetbrains.buildServer.serverSide.db.DBFunctions.create(DBFunctions.java:231)
    at jetbrains.buildServer.serverSide.db.TeamCityDatabaseManager.connect(TeamCityDatabaseManager.java:318)
    at jetbrains.buildServer.maintenance.StartupProcessor.performConnectToDatabaseInternal(StartupProcessor.java:218)
    at jetbrains.buildServer.maintenance.StartupProcessor.performConnectToDatabase(StartupProcessor.java:305)
    at jetbrains.buildServer.maintenance.StartupProcessor.doDatabaseConnect(StartupProcessor.java:425)
    at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStage(StartupProcessor.java:376)
    at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStageSafe(StartupProcessor.java:486)
    at jetbrains.buildServer.maintenance.StartupProcessor.processTeamCityLifecycle(StartupProcessor.java:448)
    at jetbrains.buildServer.maintenance.StartupProcessor.access$000(StartupProcessor.java:450)
    at jetbrains.buildServer.maintenance.StartupProcessor$1.run(StartupProcessor.java:1)
    at java.lang.Thread.run(Thread.java:744)
</pre>

5 comments
Comment actions Permalink

From teamcity-winservice.log,

[2014-05-18 12:13:34,102] stdout                            [Info] [2014-05-18 12:13:34,061]  FATAL - ldb.db.HSQLDB43D0C70F9F.ENGINE - C:/ProgramData/JetBrains/TeamCity/system/buildserver.data getFromFile 865976

Is there a command to repair buildserver.data?

0
Comment actions Permalink

Hi,

Do you have buildserver.data file in <TC Data Directory>/system/ directory?
If  buildserver.data file was deleted you need to restore TeamCity data from backup, there is no command to repair this file.

0
Comment actions Permalink

The file is there but apparently is corrupt. I don't think \ProgramData is backed up -- as I was under the impression all projects were in the user profile and found out otherwise just now. What do I need to do to get TeamCity back up so that I can look into rebuilding my project?

0
Comment actions Permalink

To recover, I backed up and then nuked programdata\jetbrains\teamcity, reinstalled, created my project with the same name, and then copied in the project files from the backup. Buildserver.data apparently contains the build history so the loss wasn't critical.

0

Please sign in to leave a comment.