Bitbucket Server failed to Start due to Required plugin failed to start

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Problem

After installing Bitbucket Server the application displays the following error message in the web browser:

A fatal error has occurred
The following problems occurred which prevents Bitbucket Server from starting correctly:
Required plugin com.atlassian.bitbucket.bitbucket-jira-integration has failed to start
Required plugin com.atlassian.crowd.embedded.admin has failed to start
Required plugin com.atlassian.bitbucket.bitbucket-rest-common has failed to start
Required plugin com.atlassian.bitbucket.bitbucket-rest has failed to start
Required plugin com.atlassian.applinks.applinks-plugin has failed to start
Required plugin com.atlassian.upm.atlassian-universal-plugin-manager-plugin has failed to start
Required plugin com.atlassian.bitbucket.bitbucket-stp-integration has failed to start
Required plugin com.atlassian.oauth.serviceprovider has failed to start
Required plugin com.atlassian.bitbucket.bitbucket-scm-git has failed to start
Required plugin com.atlassian.oauth.admin has failed to start
Required plugin com.atlassian.plugins.rest.atlassian-rest-module has failed to start

This usually occurs in the following circumstances:

  • during an upgrade
  • right after the upgrade has been performed

One of the following information is logged to atlassian-bitbucket.log:

Entry #1:

ERROR [localhost-startStop-1]  c.a.p.loaders.ScanningPluginLoader Unable to deploy plugin 'com.atlassian.plugins.rest.atlassian-rest-module' from 'Unit: /opt/bitbucket/bitbucket.norganna.org/plugins/.bundled-plugins/atlassian-rest-module-2.8.0-m7.jar (1374748504000)'.
ERROR [localhost-startStop-1]  c.a.p.loaders.ScanningPluginLoader Because of the following exception:
  java.lang.IllegalArgumentException: File must be a jar: /opt/bitbucket/bitbucket.test.instance.org/plugins/.osgi-cache/transformed-plugins/atlassian-rest-module-2.8.0-m7_1374748504000.jar
  ...
    Caused by: java.util.zip.ZipException: error in opening zip file

Entry #2:

ERROR [FelixDispatchQueue]  c.a.p.o.c.f.FelixOsgiContainerManager Framework error in bundle org.springframework.osgi.extender
  org.osgi.framework.BundleException: Activator start error in bundle org.springframework.osgi.extender [2].
    at org.apache.felix.framework.Felix.activateBundle(Felix.java:1889) ~[org.apache.felix.framework-3.0.9.jar:na]
    at java.lang.Thread.run(Thread.java:744) [na:1.8.0]
    ... 3 frames trimmed
  Caused by: java.lang.IllegalStateException: Cannot create ConcurrentHashMap - neither JDK 1.5 nor backport-concurrent available on the classpath
    at org.springframework.core.CollectionFactory.createConcurrentMap(CollectionFactory.java:229) ~[spring-core-4.0.2.RELEASE.jar:4.0.2.RELEASE]
    at java.lang.Class.newInstance(Class.java:433) ~[na:1.8.0]
    ... 2 common frames omitted

Entry #3:

WARN  [Spring DM Context Creation Timer]  o.e.g.b.e.i.d.s.DependencyWaiterApplicationContextExecutor Timeout occurred before finding service dependencies for [NonValidatingOsgiBundleXmlApplicationContext(bundle=com.atlassian.applinks.applinks-oauth-plugin, config=osgibundle:/META-INF/spring/*.xml)]
...
ERROR [Spring DM Context Creation Timer]  c.a.plugin.osgi.factory.OsgiPlugin Unable to start the plugin container for plugin 'com.atlassian.applinks.applinks-oauth-plugin'
  org.springframework.context.ApplicationContextException: Application context initialization for 'com.atlassian.applinks.applinks-oauth-plugin' has timed out waiting for (|(objectClass=com.atlassian.applinks.spi.auth.AuthenticationConfigurationManager)(objectClass=com.atlassian.applinks.spi.link.MutatingApplicationLinkService)(objectClass=com.atlassian.applinks.core.InternalTypeAccessor)(objectClass=com.atlassian.applinks.spi.manifest.ManifestRetriever))
	at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:489) ~[na:na]
	at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:54) ~[na:na]
...
ERROR [Spring DM Context Creation Timer]  o.e.g.b.e.i.s.ExtenderConfiguration Application context refresh failed (NonValidatingOsgiBundleXmlApplicationContext(bundle=com.atlassian.applinks.applinks-oauth-plugin, config=osgibundle:/META-INF/spring/*.xml))
  org.springframework.context.ApplicationContextException: Application context initialization for 'com.atlassian.applinks.applinks-oauth-plugin' has timed out waiting for (|(objectClass=com.atlassian.applinks.spi.auth.AuthenticationConfigurationManager)(objectClass=com.atlassian.applinks.spi.link.MutatingApplicationLinkService)(objectClass=com.atlassian.applinks.core.InternalTypeAccessor)(objectClass=com.atlassian.applinks.spi.manifest.ManifestRetriever))
	at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:489) [gemini-blueprint-extender-2.0.0.BUILD-atlassian-m002.jar:2.0.0.BUILD-atlassian-m002]
	at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:54) [gemini-blueprint-extender-2.0.0.BUILD-atlassian-m002.jar:2.0.0.BUILD-atlassian-m002]

Entry #4:

2022-10-31 13:12:02,197 ERROR [AtlassianEvent::thread-22]  c.a.s.i.e.AsyncBatchingInvokersTransformer There was an exception thrown trying to dispatch event 'com.atlassian.bitbucket.event.pull.PullRequestActivityEvent[source=com.atlassian.stash.internal.pull.InternalPullRequestParticipantHelper@2b6ff13b]' for the invoker 'SingleParameterMethodListenerInvoker{method=public void com.sourcegraph.webhook.WebhookListener.onPullRequestEvent(com.atlassian.bitbucket.event.pull.PullRequestEvent), listener=com.sourcegraph.webhook.WebhookListener@314f4fc3} (monitored)'
java.lang.RuntimeException: Could not initialize class com.atlassian.bitbucket.rest.pull.RestPullRequestActivity. Listener: com.sourcegraph.webhook.WebhookListener event: com.atlassian.bitbucket.event.pull.PullRequestActivityEvent
        at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:57)
        at com.atlassian.diagnostics.internal.platform.event.EventSystemMonitor.invokeMonitored(EventSystemMonitor.java:109)
        at com.atlassian.diagnostics.internal.platform.event.MonitoredListenerInvoker.invoke(MonitoredListenerInvoker.java:38)
        at com.atlassian.stash.internal.event.AsyncBatchingInvokersTransformer$AsyncInvokerBatch.invoke(AsyncBatchingInvokersTransformer.java:111)
        at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.lambda$null$0(AsynchronousAbleEventDispatcher.java:37)
        at com.atlassian.sal.core.executor.ThreadLocalDelegateRunnable.run(ThreadLocalDelegateRunnable.java:34)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at com.atlassian.stash.internal.event.EventThreadFactory.lambda$createThread$0(EventThreadFactory.java:35)
        at java.base/java.lang.Thread.run(Thread.java:829)
        ... 1 frame trimmed
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.atlassian.bitbucket.rest.pull.RestPullRequestActivity
        at jdk.internal.reflect.GeneratedConstructorAccessor777.newInstance(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at com.atlassian.stash.internal.rest.renderer.DefaultSurrogateBuilder.buildFor(DefaultSurrogateBuilder.java:34)
        at com.atlassian.stash.internal.rest.renderer.AggregateBuilder.buildFor(AggregateBuilder.java:73)
        at com.atlassian.stash.internal.rest.renderer.BaseSurrogateJsonRenderer.render(BaseSurrogateJsonRenderer.java:56)
        at com.atlassian.stash.internal.json.PluginJsonRenderer.render(PluginJsonRenderer.java:45)
        at jdk.internal.reflect.GeneratedMethodAccessor1232.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
        at jdk.internal.reflect.GeneratedMethodAccessor1232.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
        at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
        at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
        at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
        at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
        at com.sourcegraph.webhook.EventSerializer.render(EventSerializer.java:42)
        at com.sourcegraph.webhook.EventSerializer.buildPullRequestActivityEvent(EventSerializer.java:128)
        at com.sourcegraph.webhook.EventSerializer.serialize(EventSerializer.java:99)
        at com.sourcegraph.webhook.Dispatcher.<init>(Dispatcher.java:52)
        at com.sourcegraph.webhook.Dispatcher.dispatch(Dispatcher.java:106)
        at com.sourcegraph.webhook.WebhookListener.lambda$handle$0(WebhookListener.java:100)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
        at com.sourcegraph.webhook.WebhookListener.handle(WebhookListener.java:98)
        at com.sourcegraph.webhook.WebhookListener.onPullRequestEvent(WebhookListener.java:76)
        at jdk.internal.reflect.GeneratedMethodAccessor1701.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:42)
        ... 9 common frames omitted

Cause

Entry #1 and #4

Bitbucket Server will intially extract a number of core plugins from <Bitbucket Server installation directory>/atlassian-bitbucket/WEB-INF/classes/bundled-plugins.zip and put them into $BITBUCKET_HOME/plugins/.bundled-plugins/ and <BITBUCKET_HOME>/plugins/.osgi-cache/. If one or more of these extracted plugins has become corrupt Bitbucket Server will fail to start in the manner described above.

Entry #2:

BSERV-4494 - Getting issue details... STATUS  - Bitbucket Server releases older than 3.0 do not Support Java 8.

Entry #3:

The server running Bitbucket Server is not correctly sized.

Resolution

Entry #1 and #4

  1. Stop Bitbucket Service
  2. Backup and remove the following directories. They will be rebuilt when Bitbucket Server starts again.
    1. $BITBUCKET_HOME/plugins/.bundled-plugins/
    2. $BITBUCKET_HOME/plugins/.osgi-cache/
  3. Restart Bitbucket Server.

Upon starting up, Bitbucket Server will re-extract the required plugins from <Bitbucket Server installation directory>/atlassian-bitbucket/WEB-INF/classes/bundled-plugins.zip and rebuild those plugin directories.

Entry #2:

Upgrade Bitbucket Server to 3.0 or higher, or use a Java version that is described on Supported platforms.

Entry #3:

Refer to the Supported platforms page for the minimum requirements in term of CPU and Memory, and to the Memory/CPU budgeting page for further details.

Last modified on Oct 31, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.