An error was encountered during TeamCity server startup "Unexpected exception SQLException: SQL error when doing: Connecting to HSQL"

An error was encountered during TeamCity server startup

Unexpected exception SQLException: SQL error when doing: Connecting to HSQL
SQL exception: error in script file line: 187 out of memory

jetbrains.buildServer.serverSide.db.UnexpectedDBException: Unexpected exception SQLException: SQL error when doing: Connecting to HSQLSQL exception: error in script file line: 187 out of memory   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.performSequentialAttempts(TeamCityDispatcherServlet.java:419)   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$100(TeamCityDispatcherServlet.java:434)   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$3.run(TeamCityDispatcherServlet.java:3)   at java.lang.Thread.run(Unknown Source)caused by: java.sql.SQLException: error in script file line: 187 out of memory   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.performSequentialAttempts(TeamCityDispatcherServlet.java:419)   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$100(TeamCityDispatcherServlet.java:434)   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$3.run(TeamCityDispatcherServlet.java:3)   at java.lang.Thread.run(Unknown Source)

4 comments
Comment actions Permalink

Hi

Usually this error means HSQL DB files are corrupted, and cannot be recovered automatically, so the data should be recovered from backup.
For production environments we recommend to migrate to external datadase.

To ensure the database is actually corrupted, you could try to open it by a native HSQLDB tool:

  1. Stop TeamCity server
  2. Go to TeamCity Data directory (that contails buildserver.data file)
  3. Run

    java -cp \TeamCity\webapps\ROOT\WEB-INF\lib\hsqldb.jar org.hsqldb.util.DatabaseManager

  4. in a dialog, change URL field to jdbc:hsqldb:file:buildserver
  5. Click OK
  6. The same Out of memory exception should be displayed.


Michael

0
Comment actions Permalink

Fixed Error

how to fix:

1. go to C:\Documents and Settings\"..."\.BuildServer\system

2. open Buildserver.properties

3. in "hsqldb.cache_file_scale=0" change 0 to appropriate cache scale  for me 100 "hsqldb.cache_file_scale=100"

4. saved the file

5. refresh the TeamCity Project Site

0
Comment actions Permalink

Micheal Kuzmin,

Thanks for the Help sir.

Nicot

0

Please sign in to leave a comment.