Search code examples
teamcity

SQL Exception when starting TeamCity


I am having the followng error while starting TeamCity:

INFO - jetbrains.buildServer.STARTUP - Using database connection URL from the database properties file. The URL is: jdbc:hsqldb:file:$TEAMCITY_SYSTEM_PATH/buildserver

INFO - jetbrains.buildServer.STARTUP - Using internal (HSQL) database

INFO - jetbrains.buildServer.STARTUP - Current stage: Connecting to the database

ERROR - jetbrains.buildServer.STARTUP - Unexpected exception SQLException/HsqlException: SQL error when doing: Taking a connection from the data source SQL exception: error in script file line: C:\ProgramData\JetBrains\TeamCity\system\buildserver 278

INFO - jetbrains.buildServer.STARTUP - Current stage: TeamCity server startup error

Line 278 looks like this:

SET TABLE PUBLIC.PROBLEM INDEX '13402 13202 0 0 158'

Could you please help me? What could be the problem?


Solution

  • Got instructions like this: https://confluence.jetbrains.com/display/TCD10/Common+Problems#CommonProblems-Database-relatedissues

    What is more, here is a related question: https://teamcity-support.jetbrains.com/hc/en-us/community/posts/206158469-SQL-error-when-doing-Taking-a-connection-from-the-data-source

    It looks like database got corrupted. If you have backup, you need to restore from it. If not, you can only remove database and start without data, but configuration files will be preserved. For this you need to stop server and move files matching wildcard buildserver.* from /system/ directory to some other place and start server again.