Custom installation stuck at "Please wait while Bamboo sets up your database" screen - MS SQL Server
Asked by Qasim Ishaq:

I'm setting up Bamboo on my server through custom installation. I selected MS SQL Server as External Database. Filled all information. When I press "Continue" button it shows "Please wait while Bamboo sets up your database" and this screen never ends. I tried it several times even uninstalled and installed again Bamboo but got no luck. Although tables have been created in database. Tried solution at this link

<https://community.atlassian.com/t5/Bamboo-questions/Bamboo-Custom-Installation-Set-Up-Database-fails/qaq-p/778827>

But still no success. I've spend more than two days without any luck.

Following is log from "bamboo-home/log/allassian-bamboo.txt"

```
2019-03-03 10:27:01,794 WARN [C3P0PooledConnectionPoolManager[identityToken->2rxcr7a1ivggmd104056x|709642cc]-HelperThread-#0] [BasicResourcePool] Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@33321952 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
2019-03-03 10:32:57,444 INFO [http-nio-8085-exec-1] [JohnsonFilter] The application is not yet setup. Redirecting request from '/start.action' to '/bootstrap/selectSetupStep.action'
2019-03-03 10:32:57,444 INFO [http-nio-8085-exec-3] [JohnsonFilter] The application is not yet setup. Redirecting request from '/start.action' to '/bootstrap/selectSetupStep.action'
2019-03-03 10:32:57,475 INFO [http-nio-8085-exec-5] [AccessLogFilter] 0:0:0:0:0:0:0:1 GET http://localhost:8085/bootstrap/selectSetupStep.action 524618kb
2019-03-03 10:32:57,786 INFO [http-nio-8085-exec-5] [SelectSetupStepAction] Current setup step is /setup/setupDatabase.action
2019-03-03 10:32:57,838 INFO [http-nio-8085-exec-7] [AccessLogFilter] 0:0:0:0:0:0:0:1 GET http://localhost:8085/setup/setupDatabase.action 369630kb
2019-03-03 10:33:21,936 INFO [http-nio-8085-exec-11] [AccessLogFilter] 0:0:0:0:0:0:0:1 POST http://localhost:8085/setup/chooseDatabaseType.action 455822kb
2019-03-03 10:33:22,070 INFO [http-nio-8085-exec-13] [AccessLogFilter] 0:0:0:0:0:0:0:1 GET http://localhost:8085/setup/setupDatabaseConnection.action?selectedDatabase=mssql 401318kb
2019-03-03 10:34:39,835 INFO [http-nio-8085-exec-19] [AccessLogFilter] 0:0:0:0:0:0:0:1 POST http://localhost:8085/setup/performSetupDatabaseConnection.action 353965kb
2019-03-03 10:34:39,963 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Validating database configuration...
2019-03-03 10:34:39,964 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Validating connection to url: [jdbc:sqlserver://localhost:1433;databaseName=bamboo]
2019-03-03 10:34:39,993 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Database configuration is valid.
2019-03-03 10:34:39,993 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupUtilityBean] Setting up database: mssql
2019-03-03 10:34:39,994 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupUtilityBean] Bootstrapping database: mssql
2019-03-03 10:34:39,994 INFO [performSetupDatabaseConnectionBackgroundThread] [DefaultHibernateConfigurator] Saving bootstrap configuration...
2019-03-03 10:34:40,018 INFO [performSetupDatabaseConnectionBackgroundThread] [DefaultHibernateConfigurator] Refreshing Spring context...
2019-03-03 10:34:40,766 WARN [performSetupDatabaseConnectionBackgroundThread] [GenericTypeAwarePropertyDescriptor] Invalid JavaBean property 'mappingResources' being accessed! Ambiguous write methods found next to actually used [public void bucket.core.persistence.hibernate.ConfigurableLocalSessionFactoryBean.setMappingResources(bucket.core.persistence.hibernate.MappingResources)]: [public void org.springframework.orm.hibernate5.LocalSessionFactoryBean.setMappingResources(java.lang.String[])]
2019-03-03 10:34:41,526 INFO [performSetupDatabaseConnectionBackgroundThread] [AbstractPoolBackedDataSource] Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@89e9be64 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@4bf1b896 [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, identityToken -> 2rxcr7a1ivggmd104056x|76a445f8, idleConnectionTestPeriod -> 30, initialPoolSize -> 3, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 120, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 100, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@57a8741 [ description -> null, driverClass -> null, factoryClassLocation -> null, forceUseNamedDriverClass -> false, identityToken -> 2rxcr7a1ivggmd104056x|245f0656, jdbcUrl -> jdbc:sqlserver://localhost:1433;databaseName=bamboo, properties -> {handling_mode=DELAYED_ACQUISITION_AND_HOLD, user=******, password=******} ], preferredTestQuery -> null, privilegeSpawnedThreads -> false, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, extensions -> {}, factoryClassLocation -> null, identityToken -> 2rxcr7a1ivggmd104056x|1d25cf53, numHelperThreads -> 3 ]
2019-03-03 10:34:41,768 INFO [performSetupDatabaseConnectionBackgroundThread] [ResettableTableHiLoGenerator] Registering exportables...
2019-03-03 10:34:41,769 INFO [performSetupDatabaseConnectionBackgroundThread] [ResettableTableHiLoGenerator] Generator table: org.hibernate.mapping.Table(hibernate_unique_key)
2019-03-03 10:34:41,842 ERROR [performSetupDatabaseConnectionBackgroundThread] [PojoEntityTuplizer] HHH000243: Setters of lazy classes cannot be final: com.atlassian.bamboo.plan.AbstractChain.notificationSet
2019-03-03 10:34:42,140 ERROR [performSetupDatabaseConnectionBackgroundThread] [MetadataContext] HHH015007: Illegal argument on static metamodel field injection : com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationImpl_#subnetIds; expected type : org.hibernate.metamodel.internal.SingularAttributeImpl; encountered type : javax.persistence.metamodel.CollectionAttribute
2019-03-03 10:34:42,140 ERROR [performSetupDatabaseConnectionBackgroundThread] [MetadataContext] HHH015007: Illegal argument on static metamodel field injection : com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationImpl_#availabilityZones; expected type : org.hibernate.metamodel.internal.SingularAttributeImpl; encountered type : javax.persistence.metamodel.CollectionAttribute
2019-03-03 10:34:42,148 ERROR [performSetupDatabaseConnectionBackgroundThread] [MetadataContext] HHH015007: Illegal argument on static metamodel field injection : com.atlassian.bamboo.project.DefaultProject_#allPlans; expected type : org.hibernate.metamodel.internal.PluralAttributeImpl$CollectionAttributeImpl; encountered type : javax.persistence.metamodel.ListAttribute
2019-03-03 10:34:42,785 WARN [http-nio-8085-exec-19] [TokenHelper] Could not find token mapped to token name: token
2019-03-03 10:34:42,810 INFO [performSetupDatabaseConnectionBackgroundThread] [BrokerService] Using Persistence Adapter: KahaDBPersistenceAdapter[C:\Bamboo\bamboo-home\jms-store\bamboo\KahaDB]
2019-03-03 10:34:42,812 INFO [performSetupDatabaseConnectionBackgroundThread] [SharedFileLocker] Database C:\Bamboo\bamboo-home\jms-store\bamboo\KahaDB\lock is locked by another server. This broker is now in slave mode waiting a lock to be acquired
2019-03-03 10:34:44,969 ERROR [http-nio-8085-exec-21] [FiveOhOh] 500 Exception was thrown.
java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:84)
at org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:190)
at org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:176)
at org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:127)
at com.atlassian.bamboo.persistence.BambooSessionInViewFilter.doFilterInternal(BambooSessionInViewFilter.java:24)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.atlassian.bamboo.filter.BambooCompressingFilter.doFilter(BambooCompressingFilter.java:39)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.atlassian.bamboo.filter.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:40)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.atlassian.bamboo.filter.ClickjackingAndMimeTypeSniffingPreventionFilter.doFilter(ClickjackingAndMimeTypeSniffingPreventionFilter.java:36)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.atlassian.bamboo.filter.CookieCacheControlFilter.doFilter(CookieCacheControlFilter.java:49)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:64)
at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.valves.StuckThreadDetectionValve.invoke(StuckThreadDetectionValve.java:206)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
```


Answers:
author: Daniel Santos
body: Hi [@Qasim Ishaq](/t5/user/viewprofilepage/user-id/2569061)

The error you shared happens when there are multiple Bamboo processes running in the same machine using the same installation path.

I suppose that you got into this problem after facing a different issue and trying to spin up Bamboo again.

<br />

You can check if you have other Bamboo process running by using this command on windows CMD:

```
wmic path win32_process where Name='java.exe' get ProcessId,Caption,Commandline | findstr /i bamboo
```

If you have multiple processes running, kill all of them by running:

```
taskkill?/pid?<PID>
```

The **\<PID\>** is the last number returned from **wmic**. Each process returned will have one.

Let me know what you get.