TeamCity 4.5 Cannot create PoolableConnectionFactory (User not found: SA)

Today, we are experiencing a blocking issue on running Team City server.  At first, we were getting this error log.  Restarting Team City server service, we started getting a similar type of error log.  It seems that SA account is not found.  Is this caused by a corrupted HyperSQL Database file?  What are the IP and ports used by Team City internal database, so we can manually connect to it and fix the login.

Before Restarting TC server service:


ERROR -   jetbrains.buildServer.SERVER - Error preparing statement; uncategorized SQLException for SQL [UPDATE agent SET LAST_BINDING_TIMESTAMP = ? WHERE ID=?]; SQL state [null]; error code [0]; Cannot create PoolableConnectionFactory (User not found: SA); nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (User not found: SA)

org.springframework.jdbc.UncategorizedSQLException: Error preparing statement; uncategorized SQLException for SQL [UPDATE agent SET LAST_BINDING_TIMESTAMP = ? WHERE ID=?]; SQL state [null]; error code [0]; Cannot create PoolableConnectionFactory (User not found: SA); nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (User not found: SA)
 at jetbrains.buildServer.serverSide.impl.query.GenericQuery.getPreparedStatement(GenericQuery.java:14)
 at jetbrains.buildServer.serverSide.impl.query.GenericQuery.executeUpdate(GenericQuery.java:25)
 at jetbrains.buildServer.serverSide.impl.query.GenericQuery$3.run(GenericQuery.java:2)
 at jetbrains.buildServer.serverSide.impl.query.GenericQuery$3.run(GenericQuery.java)
 at jetbrains.buildServer.serverSide.impl.DBFacade$3.doInConnection(DBFacade.java:1)
 at jetbrains.buildServer.serverSide.impl.DBFacade$4.doInConnection(DBFacade.java:2)
 at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:341)
 at jetbrains.buildServer.serverSide.impl.DBFacade._runSql(DBFacade.java:27)
 at jetbrains.buildServer.serverSide.impl.DBFacade.runSql(DBFacade.java:203)
 at jetbrains.buildServer.serverSide.impl.query.GenericQuery.executeUpdate(GenericQuery.java:49)
 at jetbrains.buildServer.serverSide.impl.AgentPersistenceFacade.setBindingTimestamp(AgentPersistenceFacade.java:64)
 at jetbrains.buildServer.serverSide.impl.AbstractBuildAgent.persistCommunicationTimestamp(AbstractBuildAgent.java:25)
 at jetbrains.buildServer.serverSide.impl.AbstractBuildAgent.setCommunicationTimestamp(AbstractBuildAgent.java:80)
 at jetbrains.buildServer.serverSide.impl.XmlRpcBasedAgent$AgentTargetProxy.call(XmlRpcBasedAgent.java:9)
 at jetbrains.buildServer.serverSide.impl.XmlRpcBasedAgent.ping(XmlRpcBasedAgent.java:79)
 at jetbrains.buildServer.serverSide.impl.auth.SecuredBuildAgent.ping(SecuredBuildAgent.java:2)
 at jetbrains.buildServer.serverSide.impl.BuildAgentManagerImpl.pingAllAgents(BuildAgentManagerImpl.java:111)
 at jetbrains.buildServer.serverSide.impl.auth.SecuredBuildAgentManager.pingAllAgents(SecuredBuildAgentManager.java:30)
 at jetbrains.buildServer.serverSide.impl.BuildServerRunner$1.doSomething(BuildServerRunner.java:3)
 at jetbrains.buildServer.serverSide.impl.BuildServerRunner$BuildServerWorker.run(BuildServerRunner.java:0)
 at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (User not found: SA)
 at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
 at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
 at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)
 at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:210)
 at $Proxy8.prepareStatement(Unknown Source)
 at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.springframework.jdbc.core.JdbcTemplate$CloseSuppressingInvocationHandler.invoke(JdbcTemplate.java:1279)
 at $Proxy8.prepareStatement(Unknown Source)
 at jetbrains.buildServer.serverSide.impl.query.GenericQuery.getPreparedStatement(GenericQuery.java:91)
 ... 20 more
Caused by: java.sql.SQLException: User not found: SA
 at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
 at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
 at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
 at org.hsqldb.jdbcDriver.connect(Unknown Source)
 at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
 at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
 at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
 at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
 ... 30 more

2 comments

Hi Peter,

could you please list me files from your <TeamCity Data Path>/system directory?
Which operating system do you use? in case or Windows, how did you install TeamCity - using windows installer or unpacking from tar.gz?

Thanks,

Leonid

0

Thanks.  We did some investigation and came up with the following conclusion.  The Team City Server had a failure writing to db.  From that point on it was non-stop sql exceptions.  The real bad part was, the server went through a maintenance process where it tried to perform artifact cleanup.  During this process it does some index optimization, essentially re-writing indexes and thus re-writing buildserver.script.  Since this process also failed it took out the existing buildserver.script with it, and we ended with an almost empty buildserver.script with missing SA account creation step.  Hence when Teamcity launches the internal database, there is no SA account.

Good thing is we have a backup of the buildserver.script from another set of TeamCity server which we are cloning from.

0

Please sign in to leave a comment.