teamcity error after power failure

Hi,

We've had a power failure. After booting the system and checking & repairing the disk for errors, we get this teamcity error:

jetbrains.buildServer.serverSide.db.UnexpectedDBException: SQL error when doing: Connecting to HSQLDBSQL exception: File input/output error c:/teamcity_config/system/buildserver.backup java.io.EOFException: Unexpected end of ZLIB input stream   at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)   at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)   at jetbrains.buildServer.serverSide.db.TeamCityDataSource.checkDatabaseConnection(TeamCityDataSource.java:65)   at jetbrains.buildServer.serverSide.db.TeamCityDataSource.connect(TeamCityDataSource.java:7)   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processStartupServerInternal(TeamCityDispatcherServlet.java:48)   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processServerStartup(TeamCityDispatcherServlet.java:138)   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$000(TeamCityDispatcherServlet.java:2)   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$1.run(TeamCityDispatcherServlet.java:2)   at java.lang.Thread.run(Thread.java:595)caused by: java.sql.SQLException: File input/output error c:/teamcity_config/system/buildserver.backup java.io.EOFException: Unexpected end of ZLIB input stream   at org.hsqldb.jdbc.Util.sqlException(Unknown Source)   at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)   at org.hsqldb.jdbcDriver.getConnection(Unknown Source)   at org.hsqldb.jdbcDriver.connect(Unknown Source)   at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)   at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)   at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)   at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)   at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)   at jetbrains.buildServer.serverSide.db.TeamCityDataSource.checkDatabaseConnection(TeamCityDataSource.java:65)   at jetbrains.buildServer.serverSide.db.TeamCityDataSource.connect(TeamCityDataSource.java:7)   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processStartupServerInternal(TeamCityDispatcherServlet.java:48)   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processServerStartup(TeamCityDispatcherServlet.java:138)   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$000(TeamCityDispatcherServlet.java:2)   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$1.run(TeamCityDispatcherServlet.java:2)   at java.lang.Thread.run(Thread.java:595)

How can this be fixed?

Regards,

Bart

2 comments
Comment actions Permalink

Hi Bart,

I think the best way is to restore the data from backup.

If you have backed up the files in the directory (it is possible for internal (HSQL) database) – just restore files into this directory (rename the mangled directory before).

If you have backed up TeamCity data from TeamCity UI or using the maintainDB utility - you can restore them
using "maintainDB restore -A c:/teamcity_config -T <backup_file_name>"
(see http://confluence.jetbrains.net/display/TCD5/Restoring+TeamCity+Data+from+Backup how to restore, or just run maintainDB without parameters to see a list of possible parameters).

If you have not backed up TeamCity data, the chance to recover database successfully is too small. As I could see in the exception stack you've provided the automatic backup file is corrupted, so automatically recover procedure could not recover the data. The only chance is if the main data file is good. Please provide us with the list of files in the c:/teamcity_config/system directory (without subdirectories).

Best regards,
Leonid

0
Comment actions Permalink
Hello,


Thanks for the info!

The main datafile was missing so we've setup a new TeamCity. We're going to

migrate to postgresql in order to have a more robust datastore.


Regards,


Bart
0

Please sign in to leave a comment.