"No qualifying bean of type" errors after Bitbucket upgrade
Platform Notice: Data Center Only - This article only applies to Atlassian apps 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:
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 omittedThe "com.atlassian.plugins.authentication.atlassian-authentication-plugin" key in the error is for the SSO for Atlassian Data Center plugin:
<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:
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,auditingIdpConfigServiceDue 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:
First stop Bitbucket.
Go to the Bitbucket installation directory on the terminal to the
atlassian-bundled-pluginsdirectory:cd <Bitbucket installation directory>app/WEB-INF/atlassian-bundled-pluginsList all the bundled plugins, by running
ls -lrtaIn the list, look for the jar file named atlassian-authentication-plugin-4.2.1.jar. This is the .jarfile for the SSO plugin
Run the below command to remove the plugin
rm -rf atlassian-authentication-plugin-4.2.1.jargrepfor the jar file to see if you can find the jar file. It shouldn't be there.ls | grep atlassian-authentication-plugin-4.2.1.jarNext, 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:
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 theSSO for Atlassian Data Centerplugin. Check the version information by clicking on it. It should be 4.2.0 (or the latest version compatible with 7.13).Next, click on Install to start installing the plugin.
It may fail for the first time, as it did for me, but should be successful if you try again.
You'll be able to see the
Authentication methodsbutton from the Bitbucket Administration page again as well
The above workaround might temporarily resolve your issue and the error may recur after Bitbucket restart.
Was this helpful?