TeamCity database is empty or doesn't exist.

Hi,

We are receiving the following error when trying to access TeamCity:

TeamCity Data is Missing
TeamCity database is empty or doesn't exist. If you proceed, a new empty database will be created.
Installed TeamCity Software
Version: 6.5.4 (build 18046)
Required data format version: 454
Data directory
Path: D:\TeamCity
Data format version: 454
Database
Database: default (using internal datbase)
Data format version: empty

I've looked in the teamcity-server.log for further details, and discovered this error stack trace:

[2013-09-26 08:50:13,536]   INFO -   jetbrains.buildServer.SERVER - Server shutdown complete
[2013-09-26 08:50:45,380]   INFO -   jetbrains.buildServer.SERVER - Starting TeamCity server
[2013-09-26 08:50:45,416]   INFO -   jetbrains.buildServer.SERVER - TeamCity version: 6.5.4 (build 18046), data format version 454
[2013-09-26 08:50:46,231]   INFO -   jetbrains.buildServer.SERVER - TeamCity data directory: D:\TeamCity
[2013-09-26 08:50:47,219]   INFO -   jetbrains.buildServer.SERVER - Data directory format version: 454
[2013-09-26 08:50:48,992]   INFO -   jetbrains.buildServer.SERVER - Database type: HSQL
[2013-09-26 08:50:48,992]   INFO -   jetbrains.buildServer.SERVER - Database connection URL: jdbc:hsqldb:file:D:/TeamCity/system/buildserver
[2013-09-26 08:50:59,370]  ERROR -   jetbrains.buildServer.SERVER - Server startup exception: jetbrains.buildServer.serverSide.db.UnexpectedDBException: Unexpected exception SQLException: SQL error when doing: Connecting to HSQL
SQL exception: File input/output error
jetbrains.buildServer.serverSide.db.UnexpectedDBException: Unexpected exception SQLException: SQL error when doing: Connecting to HSQL
SQL exception: File input/output error
 at org.hsqldb.jdbc.Util.sqlException(Util.java:63)
 at org.hsqldb.jdbc.jdbcConnection.<init>(jdbcConnection.java:2430)
 at org.hsqldb.jdbcDriver.getConnection(jdbcDriver.java:183)
 at org.hsqldb.jdbcDriver.connect(jdbcDriver.java:161)
 at jetbrains.buildServer.serverSide.db.jdbcLoader.JdbcDataSource.getConnection(JdbcDataSource.java:47)
 at jetbrains.buildServer.serverSide.db.TeamCityDatabaseManager.connect(TeamCityDatabaseManager.java:219)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.setupAndConnectToDB(TeamCityDispatcherServlet.java:126)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.tryToUseDB(TeamCityDispatcherServlet.java:310)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.performOneAttempt(TeamCityDispatcherServlet.java:203)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processServerStartup(TeamCityDispatcherServlet.java:470)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$000(TeamCityDispatcherServlet.java:98)
 at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$1.run(TeamCityDispatcherServlet.java:3)
 at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: File input/output error


As you can see above, it's looking for the database connection URL in a /buildserver sub directory, but failing with a "File input/output error". As you can see in the screenshot below, our directory doesn't have this, and as far as I know, it never has:

teamcity-system dir.png

How can we fix this?

Also, we recently ran out of disk space on the server where we host TeamCity, so we removed some of the old build artifacts from our D:\TeamCity\system\artifacts\ directory. Would this have affected anything?

Regards,
Deepal

Please sign in to leave a comment.