4

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?

Jonatan Dragon
  • 4,675
  • 3
  • 30
  • 38

3 Answers3

4

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.

Jonatan Dragon
  • 4,675
  • 3
  • 30
  • 38
  • 1
    Thanks, this helped. Database being deleted means re-creating user accounts but thankfully configurations remained intact (and that's 99.9% of the work). Remote build-agent needed one button click to be re-authorized (no setup needed). – Wollan Jul 30 '17 at 21:20
0

In addition to Jonatan's answer, I determined my data directory by opening the log located at <Teamcity Home>/logs/teamcity-server.log and searched for "data directory". In my case, it was C:\ProgramData\JetBrains\TeamCity\system.

After I moved all the buildserver.* files (in my case, it was buildserver.data, buildserver.log, buildserver.properties), I opened the Teamcity UI in a browser and was prompted to enter the super user token. I determined the token by checking the end of the log at <Teamcity Home>/logs/teamcity-server.log. After entering the token into the Teamcity UI, there was a confirmation to create a new database.

datchung
  • 3,778
  • 1
  • 28
  • 29
0

If you get this error in 2022 like I did, check if Sql Browser Service is running. Turns out it needs to be running for Teamcity to start up.

J. Minjire
  • 1,003
  • 11
  • 22