Bitbucket takes much longer than normal to start
The content on this page relates to platforms which are supported; however, the content is out of scope of our Atlassian Support Offerings. Consequently, Atlassian cannot guarantee support. Please be aware that this material is provided for your information only and you may use it at your own risk.
Problem
Bitbucket takes a very long time to startup (more than 10 minutes).
Cause
#1 Disk Access Speed
Your disk speed may be slow. Perform a test for the disk access speed, and send us the output of the result.
#2 Third Party Plugin
An incompatible third party plugin could be causing the issue. Put Bitbucket in safe mode and restart the application to see if Bitbucket still takes a long time to start. See Disabling or enabling all apps (using Safe Mode) on how.
#3 You have AppDynamics set up to monitor application performance in Bitbucket
The AppDynamics performance monitory tool has a javaagent.jar with a class com.singularity.ee.agent.appagent.entrypoint.bciengine.FastMethodInterceptorDelegatorBoot which has been known slow down the Bitbucket's startup. You can diagnose this by taking thread dumps spaced at 5 second intervals during the startup of Bitbucket.
You should see threads that are BLOCKED and waiting on a lock. It is the plugin startup threads that are blocking.
"ThreadPoolAsyncTaskExecutor::Thread 63" #216 prio=5 os_prio=0 tid=0x00007f6413cfd000 nid=0x5bfc waiting for monitor entry [0x00007f6400bcc000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.singularity.ee.agent.appagent.services.transactionmonitor.bj.a(bj.java:238)
- waiting to lock <0x0000000640676e38> (a com.singularity.ee.agent.appagent.services.transactionmonitor.bj)
at com.singularity.ee.agent.appagent.services.transactionmonitor.R.a(R.java:191)
at com.singularity.ee.agent.appagent.services.transactionmonitor.R.a(R.java:139)
at com.singularity.ee.agent.appagent.services.bciengine.a.onMethodBegin(a.java:53)
at com.singularity.ee.agent.appagent.kernel.bootimpl.FastMethodInterceptorDelegatorImpl.safeOnMethodBeginNoReentrantCheck(FastMethodInterceptorDelegatorImpl.java:370)
at com.singularity.ee.agent.appagent.kernel.bootimpl.FastMethodInterceptorDelegatorImpl.safeOnMethodBegin(FastMethodInterceptorDelegatorImpl.java:295)
at com.singularity.ee.agent.appagent.entrypoint.bciengine.FastMethodInterceptorDelegatorBoot.safeOnMethodBegin(FastMethodInterceptorDelegatorBoot.java:50)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:641)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:609)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1484)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:425)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:395)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:389)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:362)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:254)
- locked <0x00000007b87041e8> (a java.lang.Object)
at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:220)
at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:224)
at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:177)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:157)
at org.eclipse.gemini.blueprint.extender.internal.activator.LifecycleManager$1.run(LifecycleManager.java:207)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Resolution
#1 Disk Access Speed
See disk access speed for resolutions.
#2 Third Party Plugin
Disable the third party plugin and contact their support team for the bug fix.
#3 You have AppDynamics set up to monitor application performance in Bitbucket
Disable AppDynamics or accept the long startups. You may be able to contact AppDyamics support for more troubleshooting steps.