Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo stuck at setting up database

I have let this run for hours and it just keeps spinning. I restarted and tried again but no luck. It does appear that at some point in time it wrote some tables to the DB so there has been a limited amount of success. I need to know how to proceed based on the log below. Thank you in advance.

 

2016-12-21 15:45:27,525 INFO [http-apr-8085-exec-2] [JohnsonFilter] The application is not yet setup. Redirecting request from '/start.action' to '/bootstrap/selectSetupStep.action'
2016-12-21 15:45:27,572 INFO [http-apr-8085-exec-3] [AccessLogFilter] 127.0.0.1 GET http://localhost:8085/bootstrap/selectSetupStep.action 452338kb
2016-12-21 15:45:27,947 INFO [http-apr-8085-exec-3] [SelectSetupStepAction] Current setup step is /setup/setupDatabase.action
2016-12-21 15:45:27,994 INFO [http-apr-8085-exec-4] [AccessLogFilter] 127.0.0.1 GET http://localhost:8085/setup/setupDatabase.action;jsessionid=94F8893F75C88709490D8B44B730DC5F 520738kb
2016-12-21 15:46:07,211 INFO [http-apr-8085-exec-6] [AccessLogFilter] 127.0.0.1 POST http://localhost:8085/setup/chooseDatabaseType.action 325056kb
2016-12-21 15:46:07,461 INFO [http-apr-8085-exec-7] [AccessLogFilter] 127.0.0.1 GET http://localhost:8085/setup/setupDatabaseConnection.action?selectedDatabase=mssql 402021kb
2016-12-21 15:46:40,405 INFO [http-apr-8085-exec-9] [AccessLogFilter] 127.0.0.1 POST http://localhost:8085/setup/performSetupDatabaseConnection.action 510971kb
2016-12-21 15:46:40,608 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Validating database configuration...
2016-12-21 15:46:40,608 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Validating connection to url: [jdbc:jtds:sqlserver://appsql_lst:1433/bamboo]
2016-12-21 15:46:40,623 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Database configuration is valid.
2016-12-21 15:46:40,623 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupUtilityBean] Setting up database: mssql
2016-12-21 15:46:40,623 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupUtilityBean] Bootstrapping database: mssql
2016-12-21 15:46:40,623 INFO [performSetupDatabaseConnectionBackgroundThread] [DefaultHibernateConfigurator] Saving bootstrap configuration...
2016-12-21 15:46:40,639 WARN [performSetupDatabaseConnectionBackgroundThread] [AbstractDom4jXmlConfigurationPersister] Unable to move C:\bamboo-home\bamboo.cfg.xml1215872482676865978tmp to C:\bamboo-home\bamboo.cfg.xml. Falling back to non-atomic overwrite.
2016-12-21 15:46:40,639 INFO [performSetupDatabaseConnectionBackgroundThread] [DefaultHibernateConfigurator] Refreshing Spring context...
2016-12-21 15:46:41,139 INFO [performSetupDatabaseConnectionBackgroundThread] [BambooBootstrapPlaceholderConfigurer] Loading properties file from class path resource [bamboo-init.properties]
2016-12-21 15:46:41,186 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.hibernate4.LocalSessionFactoryBean.setMappingResources(java.lang.String[])]
2016-12-21 15:46:41,576 INFO [performSetupDatabaseConnectionBackgroundThread] [AbstractPoolBackedDataSource] Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@74b5bd48 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@4fba8759 [ 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 -> 2wz4ml9l9sxs0nh8d1rw|1a201971, 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@7bcfcbfa [ description -> null, driverClass -> null, factoryClassLocation -> null, forceUseNamedDriverClass -> false, identityToken -> 2wz4ml9l9sxs0nh8d1rw|eb2e70d, jdbcUrl -> jdbc:jtds:sqlserver://appsql_lst:1433/bamboo, properties -> {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 -> 2wz4ml9l9sxs0nh8d1rw|3f2b75dd, numHelperThreads -> 3 ]
2016-12-21 15:46:43,701 WARN [http-apr-8085-exec-9] [TokenHelper] Could not find token mapped to token name: token
2016-12-21 15:46:44,692 WARN [performSetupDatabaseConnectionBackgroundThread] [LuceneConnection] Forcing unlock of locked index directory: org.apache.lucene.store.MMapDirectory@C:\bamboo-home\index\results lockFactory=org.apache.lucene.store.NativeFSLockFactory@5d9cfec1
2016-12-21 15:46:44,692 WARN [performSetupDatabaseConnectionBackgroundThread] [DefaultListableBeanFactory] Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'planStatePersister' defined in class path resource [applicationContextManagers.xml]: Cannot create inner bean 'com.atlassian.bamboo.plan.PlanStatePersisterImpl#2bdf163f' of type [com.atlassian.bamboo.plan.PlanStatePersisterImpl] while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.atlassian.bamboo.plan.PlanStatePersisterImpl#2bdf163f' defined in class path resource [applicationContextManagers.xml]: Cannot resolve reference to bean 'buildResultsIndexer' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'buildResultsIndexer' defined in class path resource [applicationContextManagers.xml]: Cannot create inner bean 'com.atlassian.bamboo.index.buildresult.DefaultBuildResultsIndexer#586c8711' of type [com.atlassian.bamboo.index.buildresult.DefaultBuildResultsIndexer] while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.atlassian.bamboo.index.buildresult.DefaultBuildResultsIndexer#586c8711' defined in class path resource [applicationContextManagers.xml]: Cannot resolve reference to bean 'buildResultLuceneConnection' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'buildResultLuceneConnection' defined in class path resource [applicationContextManagers.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.bamboo.index.LuceneConnectionImpl]: Constructor threw exception; nested exception is com.atlassian.bonnie.LuceneException: org.apache.lucene.store.LockReleaseFailedException: Cannot forcefully unlock a NativeFSLock which is held by another indexer component: C:\bamboo-home\index\results\write.lock
2016-12-21 15:46:44,785 INFO [performSetupDatabaseConnectionBackgroundThread] [BrokerService] Using Persistence Adapter: KahaDBPersistenceAdapter[C:\bamboo-home\jms-store\bamboo\KahaDB]
2016-12-21 15:46:44,785 INFO [performSetupDatabaseConnectionBackgroundThread] [SharedFileLocker] Database C:\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
2016-12-21 15:46:46,207 ERROR [http-apr-8085-exec-10] [FiveOhOh] 500 Exception was thrown.
java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:83)
at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:189)
at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:175)
at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:126)
at com.atlassian.bamboo.persistence.BambooSessionInViewFilter.doFilterInternal(BambooSessionInViewFilter.java:28)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.atlassian.bamboo.filter.BambooCompressingFilter.doFilter(BambooCompressingFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.atlassian.bamboo.filter.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:39)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.atlassian.bamboo.filter.ClickjackingPreventionFilter.doFilter(ClickjackingPreventionFilter.java:31)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.atlassian.bamboo.filter.CookieCacheControlFilter.doFilter(CookieCacheControlFilter.java:55)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
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:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.valves.StuckThreadDetectionValve.invoke(StuckThreadDetectionValve.java:206)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
rsperafico Atlassian Team Dec 21, 2016

Hello,

It seems some files are locked by another process. Since you have restarted Bamboo, this process could haven't being stopped completely before Bamboo restart and because of that:

Cannot forcefully unlock a NativeFSLock which is held by another indexer component: C:\bamboo-home\index\results\write.lock
...
Database C:\bamboo-home\jms-store\bamboo\KahaDB\lock is locked by another server.

I would recommend you on:

Kind regards,

Rafael

I have also now tried stopping the service, deleting the locked files C:\bamboo-home\jms-store\bamboo\KahaDB\lock and C:\bamboo-home\index\results\write.lock, and restarting. The files are recreated but the error comes back. ProcessExplorere says tomcat8.exe is the process that appears to be locking the files but this exe is started by the bamboo service. 

What you recommend appears to be a near-complete fresh start. Will try that in the morning if  nothing magically fixes it over night. 

This did fix the issue however I would have appreciated a simpler method that didn't require undoing all previous progress. Like I mentioned, Bamboo was locking the files from itself and I'm hoping that doesn't recur. 

I wouldn't recommend deleting all your previously setup Bamboo directories. This issue happened to me when Bamboo couldn't resolve  some entries of  Local DNS entries, thus causing Bamboo to get stuck on setting up page after creating the Admin, displaying Please Wait message for ever. I restarted the server and I got the error on the title of this thread (Locked db by another server).  I am using Centos 6. Below are the steps I have taken to fix the issue. 

 

  1. Stop the Bamboo server
  2. Do a simple pgrep on the Java ( pgrep java).
  3. Kill ALL the processes that it returns that relate to Bamboo, use ps to check (ps 12343) if process is Atlassian Bamboo, you may get more than one process running , then kill them all..  As a root user, I use this command          kill -9 12343    assuming 12343 is the process ID.
  4. Then delete the lock file 
    rm -rf /var/atlassian/application-data/bamboo/jms-store/bamboo/KahaDB/lock
  5. Restart Bamboo as usual 

 

/var/atlassian/application-data/bamboo is where I told Bamboo store Bamboo data (not the installation Directory

 

 

Like Tjorven Beckedorf likes this

Thanks to Ahmed Dini.

This fixed it without any data loss.

I just needed  steps 1, 2, 3 and 5 to resolve the issue.

 

 

If using SQL SERVER, make sure your database has the correct collation type (SQL_Latin1_General_CP1_CS_AS) for bamboo database and configure database to use correct isolation level, you can use this:

ALTER DATABASE <database name>
SET READ_COMMITTED_SNAPSHOT ON
WITH ROLLBACK IMMEDIATE;

This resolved my issue in addition with Rafael's steps above.

I have a similar issue in linux and which the process at some point started by another user/owner and locked the db.

The following steps is what helped me.

1. find who owns the bamboo process and note down the user (bamboo)
ps -ef|grep bamboo

2. stop the bamboo services
sudo service bamboo stop or kill -9 <bambooPID>

3. check to see if the files owner has been changed. If so, change the owner to the user in step 1.
ls -l /data/bamboo_home/jms-store/bamboo/KahaDB/
chown -R bamboo:bamboo /data/bamboo_home/jms-store/bamboo/KahaDB/*

4. find out all the write.lock files under bamboo_home dir and remove them
cd /data/bamboo_home
find . -name "write.lock"
sudo rm -r ./version/write.lock
sudo rm -f ./results/write.lock
sudo rm -f ./search/write.lock

5. restart the service
sudo service bamboo start

I have done all the steps but issue persist.

 

1. find who owns the bamboo process and note down the user (bamboo)
ps -ef|grep bamboo

2. stop the bamboo services
sudo service bamboo stop or kill -9 <bambooPID>

3. check to see if the files owner has been changed. If so, change the owner to the user in step 1.
ls -l /data/bamboo_home/jms-store/bamboo/KahaDB/
chown -R bamboo:bamboo /data/bamboo_home/jms-store/bamboo/KahaDB/*

4. find out all the write.lock files under bamboo_home dir and remove them
cd /data/bamboo_home
find . -name "write.lock"
sudo rm -r ./version/write.lock
sudo rm -f ./results/write.lock
sudo rm -f ./search/write.lock

5. restart the service
sudo service bamboo start

Thanks Eddie, that got me back up and running!

TAGS
Community showcase
Published in Jira Service Management

JSM June ask me anything (AMA)

Hello Community members! We’re wrapping up the end of JSM June with an Ask Me Anything (AMA) with the Jira Service Management product team. This is your chance to ask all your ITSM questions to o...

146 views 9 10
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you