"No qualifying bean of type" errors after Bitbucket upgrade

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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

Summary

"No qualifying bean of type" errors in Bitbucket

Environment

Bitbucket version: 7.13.0

SSO for Atlassian Data Center plugin version: 4.2.0

Diagnosis

This issue can occur after upgrading to Bitbucket 7.13.  The Authentication methods button from the Bitbucket Administration page disappears. That is because the SSO for Atlassian Data Center plugin is disabled.

Bitbucket logs will have the following error:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 2021-05-27 11:08:13,131 ERROR [ThreadPoolAsyncTaskExecutor::Thread 39] c.a.plugin.osgi.factory.OsgiPlugin Unable to start the plugin container for plugin 'com.atlassian.plugins.authentication.atlassian-authentication-plugin' org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ssoConfigServiceImpl': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atlassian.plugins.authentication.api.config.IdpConfigService' available: expected single matching bean but found 2: idpConfigServiceImpl,auditingIdpConfigService at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:799) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:57) at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:322) at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:287) at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:137) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.lang.Thread.run(Thread.java:748) ... 11 frames trimmed Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atlassian.plugins.authentication.api.config.IdpConfigService' available: expected single matching bean but found 2: idpConfigServiceImpl,auditingIdpConfigService at org.springframework.beans.factory.config.DependencyDescriptor.resolveNotUnique(DependencyDescriptor.java:220) ... 9 common frames omitted 2021-05-27 11:08:13,230 ERROR [ThreadPoolAsyncTaskExecutor::Thread 39] o.e.g.b.e.i.s.ExtenderConfiguration Application context refresh failed (NonValidatingOsgiBundleXmlApplicationContext(bundle=com.atlassian.plugins.authentication.atlassian-authentication-plugin, config=osgibundle:/META-INF/spring/*.xml)) org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ssoConfigServiceImpl': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atlassian.plugins.authentication.api.config.IdpConfigService' available: expected single matching bean but found 2: idpConfigServiceImpl,auditingIdpConfigService at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:799) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:57) at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:322) at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:287) at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:137) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.lang.Thread.run(Thread.java:748) ... 11 frames trimmed Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atlassian.plugins.authentication.api.config.IdpConfigService' available: expected single matching bean but found 2: idpConfigServiceImpl,auditingIdpConfigService at org.springframework.beans.factory.config.DependencyDescriptor.resolveNotUnique(DependencyDescriptor.java:220) ... 9 common frames omitted 2021-05-27 11:08:13,233 ERROR [ThreadPoolAsyncTaskExecutor::Thread 39] o.e.g.b.e.i.d.s.DependencyWaiterApplicationContextExecutor Unable to create application context for [com.atlassian.plugins.authentication.atlassian-authentication-plugin], unsatisfied dependencies: none org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ssoConfigServiceImpl': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atlassian.plugins.authentication.api.config.IdpConfigService' available: expected single matching bean but found 2: idpConfigServiceImpl,auditingIdpConfigService at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:799) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:57) at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:322) at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:287) at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:137) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.lang.Thread.run(Thread.java:748) ... 11 frames trimmed Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atlassian.plugins.authentication.api.config.IdpConfigService' available: expected single matching bean but found 2: idpConfigServiceImpl,auditingIdpConfigService at org.springframework.beans.factory.config.DependencyDescriptor.resolveNotUnique(DependencyDescriptor.java:220) ... 9 common frames omitted

The "com.atlassian.plugins.authentication.atlassian-authentication-plugin" key in the error is for the SSO for Atlassian Data Center plugin:

1 2 3 4 5 6 7 8 9 10 <plugin> <key>com.atlassian.plugins.authentication.atlassian-authentication-plugin</key> <name>SSO for Atlassian Data Center</name> <version>4.2.1</version> <vendor>Atlassian</vendor> <status>DISABLED</status> <vendor-url>https://www.atlassian.com/</vendor-url> <framework-version>2</framework-version> <bundled>Bundled</bundled> </plugin>

Cause

The Caused by is same for all the above errors:

1 Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atlassian.plugins.authentication.api.config.IdpConfigService' available: expected single matching bean but found 2: idpConfigServiceImpl,auditingIdpConfigService

Due to this bug BSERV-12895 - SSO for Atlassian Data Center (embedded plugin) can't be enabled after upgrading to Bitbucket 7.13+ the plugin loader picks up incorrect version of plugin library which prevents the plugin from successful start.

Solution

Workaround

Remove the pre-installed SSO for Atlassian Data Center plugin from Bitbucket and install the latest version available.  If you don't see the option on the Bitbucket UI to remove the plugin, please remove the .jar file for this plugin.

To delete the .jar file from the installation directory, follow the steps below:

  1. First stop Bitbucket.

  2. Go to the Bitbucket installation directory on the terminal to the atlassian-bundled-plugins directory:

    1 cd <Bitbucket installation directory>app/WEB-INF/atlassian-bundled-plugins
  3. List all the bundled plugins, by running ls -lrta

  4. In the list, look for the jar file named atlassian-authentication-plugin-4.2.1.jar. This is the .jarfile for the SSO plugin

  5. Run the below command to remove the plugin

    1 rm -rf atlassian-authentication-plugin-4.2.1.jar
  6. grep for the jar file to see if you can find the jar file. It shouldn't be there.

    1 ls | grep atlassian-authentication-plugin-4.2.1.jar
  7. Next, restart Bitbucket and go to Manage Apps page, search for this plugin, you won't be able to find it. This means the plugin has been successfully removed.

Now follow the steps below to install the latest version of the plugin:

  1. In the Bitbucket UI, go to Find new apps page, in the search bar, type the plugin key com.atlassian.plugins.authentication.atlassian-authentication-plugin. You'll see the SSO for Atlassian Data Center plugin. Check the version information by clicking on it. It should be 4.2.0 (or the latest version compatible with 7.13).

  2. Next, click on Install to start installing the plugin.

  3. It may fail for the first time, as it did for me, but should be successful if you try again.

  4. You'll be able to see the Authentication methods button from the Bitbucket Administration page again as well

The above workaround might temporarily resolve your issue and the error may recur after Bitbucket restart.

Updated on February 25, 2025

Still need help?

The Atlassian Community is here for you.