Bamboo running as a Windows service fails to start up with 'cannot open database requested by the login'


アトラシアン コミュニティをご利用ください。


プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。


Bamboo fails to start up with the following error message in the <bamboo-home-directory>/logs/atlassian-bamboo.log file:

2015-12-21 21:43:44,071 INFO [localhost-startStop-1] [AbstractPoolBackedDataSource] Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@cabdcc40 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@f69127a3 [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1us3ul19d1jdf6yu1eqfbgb|10312c13, idleConnectionTestPeriod -> 100, initialPoolSize -> 0, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 30, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 100, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 0, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@c0c870e [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 1us3ul19d1jdf6yu1eqfbgb|5ef5d9c4, jdbcUrl -> jdbc:jtds:sqlserver://localhost:1433/bamboo, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, factoryClassLocation -> null, identityToken -> 1us3ul19d1jdf6yu1eqfbgb|56a7ba52, numHelperThreads -> 3 ]
2015-12-21 21:44:30,871 WARN [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] [BasicResourcePool] com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7b36670b -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 
java.sql.SQLException: Cannot open database "bamboo" requested by the login. The login failed.
	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(
	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(
	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(
	at net.sourceforge.jtds.jdbc.TdsCore.login(
	at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(
	at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(
	at net.sourceforge.jtds.jdbc.Driver.connect(
	at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(
	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(
	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(
	at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(
	at com.mchange.v2.resourcepool.BasicResourcePool.access$800(
	at com.mchange.v2.resourcepool.BasicResourcePool$
	at com.mchange.v2.async.ThreadPoolAsynchronousRunner$



Bamboo is running as a Windows service and is connected to a Microsoft SQL Server database. Both Bamboo and SQL Server are located inside the same machine.


The problem only happens when the machine is restarted. If the service is then manually stopped/started, it starts working again.


It seems that Bamboo is unable to establish a connection to the Microsoft SQL Server database. When the server is restarted, Bamboo keeps trying to start up but the database is not ready yet, it is still booting up when Bamboo is trying to connect to it.


The best solution here is to set the Bamboo service with a startup type Automatic (Delayed Start).

A service marked as Automatic (Delayed Start) will start shortly after all other services designated as Automatic have been started. If you have a few services that are critical, then you may want to set those few to Automatic and set as many of the others as you can to Automatic (Delayed Start). This will ensure that the critical services get the most resources early and become available sooner, while the non-critical services start a bit later.

Last modified on Mar 30, 2016


Powered by Confluence and Scroll Viewport.