TeamCity has failed to start

Hi all,

I've inherited a TeamCity build server that is currently not running.  I believe the previous administrator was attempting an upgrade to teamcity when it broke. can anyone help me with steps to repair this instance of TeamCity and get it running again?

TeamCity has failed to start

TeamCity server startup error

Could not determine database version. 
See details at http://confluence.jetbrains.com/display/TCD9/Upgrade.

Current Startup State

Startup status

Current step: TeamCity server startup error
Next step: not defined yet

Data Directory

Directory path: C:\TeamCityConfig\.BuildServer exists
Database properties file not found
Internal database file: 1.8.1

Database

Database type: default (using internal database)
Database connection URL: jdbc:hsqldb:file:$TEAMCITY_SYSTEM_PATH/buildserver
JDBC driver version: 1.8 (HSQL Database Engine Driver)
Database system version: 1.8.1 (HSQL Database Engine)

Versions

Software version: 709
Data directory version: 658
Database version: unknown

Logs

Logs path: C:\TeamCity\logs

20 comments

Hi Matt,

Please check that C:\TeamCityConfig\.BuildServer is a Data Directory and that database properties file is configured correctly. Also check that all Upgrade steps were performed.
If it is not the case then check that please attach teamcity0server.log file.

0

Thanks for your reply Alina,

I checked the data directory and it appears intact.

I'm showing in the /config folder that there are multiple files similar to database.mssql.properties.dist but there is not a file named "database.properties" and I see this in the teamcity-server.log

"Database properties file "C:\TeamCityConfig\.BuildServer\config\database.properties" doesn't exist"

here's the server log if that helps:

[2015-02-11 09:34:40,509]   INFO -  jetbrains.buildServer.STARTUP - ===========================================================
[2015-02-11 09:34:40,509]   INFO -  jetbrains.buildServer.STARTUP - Starting TeamCity server
[2015-02-11 09:34:41,924]   INFO -  jetbrains.buildServer.STARTUP - TeamCity version: 9.0.1 (build 32116), data format version 709
[2015-02-11 09:34:41,924]   INFO -  jetbrains.buildServer.STARTUP - OS: Windows 7, User: TeamCityUser, JRE: 1.7.0_72-b14 Java HotSpot(TM) Server VM (32 bit)
[2015-02-11 09:34:41,924]   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/ -Djsse.enableSNIExtension=false -Djava.endorsed.dirs=c:\TeamCity\bin\..\endorsed -Dcatalina.base=c:\TeamCity\bin\.. -Dcatalina.home=c:\TeamCity\bin\.. -Djava.io.tmpdir=c:\TeamCity\bin\..\temp
[2015-02-11 09:34:41,924]   INFO -  jetbrains.buildServer.STARTUP - Garbage collection: PS Scavenge, PS MarkSweep
[2015-02-11 09:34:42,166]   INFO -  jetbrains.buildServer.STARTUP - Web server version: Apache Tomcat/7.0.57
[2015-02-11 09:34:42,166]   INFO -  jetbrains.buildServer.STARTUP - Server IP address: 192.168.111.46
[2015-02-11 09:34:42,166]   INFO -  jetbrains.buildServer.STARTUP - Servlet real path: c:\TeamCity\bin\..\webapps\ROOT\
[2015-02-11 09:34:42,166]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Looking for the TeamCity Data Directory
[2015-02-11 09:34:42,166]   INFO -  jetbrains.buildServer.STARTUP - TeamCity Data Directory path is determined using the environment variable TEAMCITY_DATA_PATH
[2015-02-11 09:34:42,166]   INFO -  jetbrains.buildServer.STARTUP - Data Directory "C:\TeamCityConfig\.BuildServer" exists
[2015-02-11 09:34:49,370]   INFO -  jetbrains.buildServer.STARTUP - The main configuration file "C:\TeamCityConfig\.BuildServer\config\main-config.xml" exists
[2015-02-11 09:34:49,370]   INFO -  jetbrains.buildServer.STARTUP - The database properties file "C:\TeamCityConfig\.BuildServer\config\database.properties" doesn't exist
[2015-02-11 09:34:49,370]   INFO -  jetbrains.buildServer.STARTUP - The internal database data file "C:\TeamCityConfig\.BuildServer\system\buildserver.data" exists
[2015-02-11 09:34:49,869]   INFO -  jetbrains.buildServer.STARTUP - Data Directory version: 658
[2015-02-11 09:34:49,869]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Looking for the database configuration
[2015-02-11 09:34:49,869]   INFO -  jetbrains.buildServer.STARTUP - Database properties file "C:\TeamCityConfig\.BuildServer\config\database.properties" doesn't exist
[2015-02-11 09:34:49,869]   INFO -  jetbrains.buildServer.STARTUP - Internal HSQL database file (C:\TeamCityConfig\.BuildServer\system\buildserver.data) exists, version: 1.8.1
[2015-02-11 09:34:49,869]   INFO -  jetbrains.buildServer.STARTUP - Using internal (HSQL) database
[2015-02-11 09:34:49,869]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Connecting to the database
[2015-02-11 09:38:31,901]   INFO -  jetbrains.buildServer.STARTUP - JDBC driver version: 1.8 (HSQL Database Engine Driver)
[2015-02-11 09:38:31,901]   INFO -  jetbrains.buildServer.STARTUP - Database system version: 1.8.1 (HSQL Database Engine)
[2015-02-11 09:38:31,901]   INFO -  jetbrains.buildServer.STARTUP - Connected to the database successfully
[2015-02-11 09:38:31,901]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Checking the database
[2015-02-11 09:38:32,216]   INFO -  jetbrains.buildServer.STARTUP - Using schema: PUBLIC
[2015-02-11 09:38:32,220]   INFO -  jetbrains.buildServer.STARTUP - Schema contains 120 tables.
[2015-02-11 09:38:32,224]   INFO -  jetbrains.buildServer.STARTUP - Database version is 0
[2015-02-11 09:38:32,228]   INFO -  jetbrains.buildServer.STARTUP - Current stage: TeamCity server startup error

0

Can anybody tell me why it's saying Database version is 0? Is that what is causing the error? Thanks for any help.

0

bump, can anybody please help me? i need to get this TeamCity instance back up and running badly. thanks!

0

Hi Matt,

Sorry for delay. It's strange that there is no database.properties in TeamCity Data directory. What type of database was used before? Please create database.properties file. If you want to use internal database then copy "database.hsqldb.properties.dist" to the "database.properties" file, if you use external database then set it up as describe in documentation: https://confluence.jetbrains.com/display/TCD9/Setting+up+an+External+Database

database.mssql.properties.dist and other .dist files are template files with database-specific properties.

0

Thanks for the reply.

Is it possible that it was just using the internal database? I read somewhere that there is no database.properties files if it's using the internal database.

0

I've added the database.properties file as you suggested and restarted the server. here's the current logs

[2015-02-13 10:23:08,565]   INFO -  jetbrains.buildServer.STARTUP - ===========================================================
[2015-02-13 10:23:08,565]   INFO -  jetbrains.buildServer.STARTUP - Starting TeamCity server
[2015-02-13 10:23:09,090]   INFO -  jetbrains.buildServer.STARTUP - TeamCity version: 9.0.1 (build 32116), data format version 709
[2015-02-13 10:23:09,139]   INFO -  jetbrains.buildServer.STARTUP - OS: Windows 7, User: TeamCityUser, JRE: 1.7.0_72-b14 Java HotSpot(TM) Server VM (32 bit)
[2015-02-13 10:23:09,139]   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/ -Djsse.enableSNIExtension=false -Djava.endorsed.dirs=c:\TeamCity\bin\..\endorsed -Dcatalina.base=c:\TeamCity\bin\.. -Dcatalina.home=c:\TeamCity\bin\.. -Djava.io.tmpdir=c:\TeamCity\bin\..\temp
[2015-02-13 10:23:09,140]   INFO -  jetbrains.buildServer.STARTUP - Garbage collection: PS Scavenge, PS MarkSweep
[2015-02-13 10:23:09,339]   INFO -  jetbrains.buildServer.STARTUP - Web server version: Apache Tomcat/7.0.57
[2015-02-13 10:23:09,340]   INFO -  jetbrains.buildServer.STARTUP - Server IP address: 192.168.111.46
[2015-02-13 10:23:09,340]   INFO -  jetbrains.buildServer.STARTUP - Servlet real path: c:\TeamCity\bin\..\webapps\ROOT\
[2015-02-13 10:23:09,349]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Looking for the TeamCity Data Directory
[2015-02-13 10:23:09,349]   INFO -  jetbrains.buildServer.STARTUP - TeamCity Data Directory path is determined using the environment variable TEAMCITY_DATA_PATH
[2015-02-13 10:23:09,349]   INFO -  jetbrains.buildServer.STARTUP - Data Directory "C:\TeamCityConfig\.BuildServer" exists
[2015-02-13 10:23:09,389]   INFO -  jetbrains.buildServer.STARTUP - The main configuration file "C:\TeamCityConfig\.BuildServer\config\main-config.xml" exists
[2015-02-13 10:23:09,389]   INFO -  jetbrains.buildServer.STARTUP - The database properties file "C:\TeamCityConfig\.BuildServer\config\database.properties" exists
[2015-02-13 10:23:09,389]   INFO -  jetbrains.buildServer.STARTUP - The internal database data file "C:\TeamCityConfig\.BuildServer\system\buildserver.data" exists
[2015-02-13 10:23:09,463]   INFO -  jetbrains.buildServer.STARTUP - Data Directory version: 658
[2015-02-13 10:23:09,463]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Looking for the database configuration
[2015-02-13 10:23:09,463]   INFO -  jetbrains.buildServer.STARTUP - Database properties file "C:\TeamCityConfig\.BuildServer\config\database.properties" exists
[2015-02-13 10:23:09,464]   INFO -  jetbrains.buildServer.STARTUP - Internal HSQL database file (C:\TeamCityConfig\.BuildServer\system\buildserver.data) exists, version: 1.8.1
[2015-02-13 10:23:09,464]   INFO -  jetbrains.buildServer.STARTUP - Database connection URL: jdbc:hsqldb:file:$TEAMCITY_SYSTEM_PATH/buildserver
[2015-02-13 10:23:09,465]   INFO -  jetbrains.buildServer.STARTUP - Using database connection URL from the database properties file. The URL is: jdbc:hsqldb:file:$TEAMCITY_SYSTEM_PATH/buildserver
[2015-02-13 10:23:09,466]   INFO -  jetbrains.buildServer.STARTUP - Using internal (HSQL) database
[2015-02-13 10:23:09,466]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Connecting to the database
[2015-02-13 10:23:10,171]   INFO -  jetbrains.buildServer.STARTUP - JDBC driver version: 1.8 (HSQL Database Engine Driver)
[2015-02-13 10:23:10,171]   INFO -  jetbrains.buildServer.STARTUP - Database system version: 1.8.1 (HSQL Database Engine)
[2015-02-13 10:23:10,171]   INFO -  jetbrains.buildServer.STARTUP - Connected to the database successfully
[2015-02-13 10:23:10,171]   INFO -  jetbrains.buildServer.STARTUP - Current stage: Checking the database
[2015-02-13 10:23:10,208]   INFO -  jetbrains.buildServer.STARTUP - Using schema: PUBLIC
[2015-02-13 10:23:10,213]   INFO -  jetbrains.buildServer.STARTUP - Schema contains 120 tables.
[2015-02-13 10:23:10,230]   INFO -  jetbrains.buildServer.STARTUP - Database version is 0
[2015-02-13 10:23:10,234]   INFO -  jetbrains.buildServer.STARTUP - Current stage: TeamCity server startup error

0

Please try to stop current TeamCity 9.0.1 instance, install TeamCity 8.1 (you can download it here) and run it with the same <TeamCity data directory>. Does it start successfully?

0

If i do that will it wipe out my existing database and settings?

0

No, all config files and internal database are stored in TeamCity Data directory "C:\TeamCityConfig\.BuildServer\" - do not delete it (also it is recommended to create a copy of this folder).

0

I ran the installer for TeamCity 8.1 and ended up with the same error.

I ended up completely uninstalling and reinstalling TeamCity 8.1 and now have a new instance running.

Is it possible to restore any of my configurations or build tasks from the backups i have of my old TeamCity instance?

thanks!

0

Hi Matt,

Yes, you can restore your configurations from backup. Backups created with TeamCity 6.0 or more recent versions can be restored using the same or more recent TeamCity versions if you are restoring to the same database.
Please read how to restore TeamCity Data: https://confluence.jetbrains.com/display/TCD8/Restoring+TeamCity+Data+from+Backup

0

I was looking through that article but wasn't sure if it would work since my backup database is corrupted

0

If you have a backup of corrupted database, then unfortunately there is no way to recovery TeamCity data. Please scan TeamCity server machine perhaps there were backups created before the database corrupted.

0

There are zip files in the TeamCityConfig/.BuildServer/backup folder that have timestamps from before the database got corrupted. do those backups contain what i need to restore the database?

0

It depends on backup type. If it is a basic backup then it contains database, server settings, projects and builds configurations, plugins. You can open .zip file to check what is stored in it. Database is stored in "database_dump" folder.

0

They do have a database_dump folder which contains a series of files like

db_version
canceled_info
usergroup_roles

etc...

0

You can try to restore this backup, to check what data is saved in it.

0

I don't quite understand these instructions... am i supposed to delete everything in the .BuildServer folder and then use the maintainDB utility to restore? Also it doesn't tell me where to get the drivers that i'm supposed to be putting in the lib folder.

Sorry for my questions but i want to get this right.

0

Sorry for delay. You can create a copy of current .BuildServer folder and then delete it. Then you need to configure external database. You can find links to drivers for different databases on this page https://confluence.jetbrains.com/display/TCD9/Setting+up+an+External+Database. And then restore TeamCity data using maintainDB command.

0

Please sign in to leave a comment.