TC failed to start with exception. Please help

The TC stopped responding and when I tried to restart the service it failed with the following exception:

SQL exception: error in script file line: 47654 org.hsqldb.HsqlException:

jetbrains.buildServer.serverSide.db.DBDuplicatedRowException: SQL error when doing: Connecting to HSQLDB
SQL exception: error in script file line: 47654 org.hsqldb.HsqlException: Violation of unique constraint AGENT_TYPE_PARAM_PK: duplicate value(s) for column(s) AGENT_TYPE_ID,PARAM_KIND,PARAM_NAME
   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:215)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.setupAndConnectToDB(TeamCityDispatcherServlet.java:72)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.tryToUseDB(TeamCityDispatcherServlet.java:429)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.performOneAttempt(TeamCityDispatcherServlet.java:200)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.performSequentialAttempts(TeamCityDispatcherServlet.java:331)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$100(TeamCityDispatcherServlet.java:245)
   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: 47654 org.hsqldb.HsqlException: Violation of unique constraint AGENT_TYPE_PARAM_PK: duplicate value(s) for column(s) AGENT_TYPE_ID,PARAM_KIND,PARAM_NAME
   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:215)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.setupAndConnectToDB(TeamCityDispatcherServlet.java:72)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.tryToUseDB(TeamCityDispatcherServlet.java:429)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.performOneAttempt(TeamCityDispatcherServlet.java:200)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.performSequentialAttempts(TeamCityDispatcherServlet.java:331)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$100(TeamCityDispatcherServlet.java:245)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$3.run(TeamCityDispatcherServlet.java:3)
   at java.lang.Thread.run(Unknown Source)



Any advise how to recover?

Please sign in to leave a comment.