Connecting Bitbucket Server to JIRA for User Management Fails

Still need help?

The Atlassian Community is here for you.

Ask the community

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

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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

Problem

After testing the connectivity between Bitbucket Server and JIRA User Management, the connection fails in the UI and the following appears in the atlassian-bitbucket.log:

2014-01-23 13:16:51,800 ERROR [http-bio-7990-exec-1] build 796x7756x0 15rk9g2 192.168.2.135,127.0.0.1 "POST /plugins/servlet/embedded-crowd/configure/jira/ HTTP/1.1" c.a.c.e.a.ConfigurationController Configuration test failed for user directory: [ ACM Corporation JIRA], type: [ CROWD ]
com.atlassian.crowd.exception.runtime.OperationFailedException: com.atlassian.crowd.exception.InvalidAuthenticationException: Application failed to authenticate
...
Caused by: com.atlassian.crowd.exception.InvalidAuthenticationException: Application failed to authenticate
...
2014-05-07 10:06:57,751 ERROR [scheduler_Worker-7]  c.a.c.d.DbCachingDirectoryPoller Error occurred while refreshing the cache for directory [ 2097154 ].
com.atlassian.crowd.exception.OperationFailedException: com.atlassian.crowd.exception.InvalidAuthenticationException: Application failed to authenticate
...
...

Cause

In order to be able to connect Bitbucket Server to JIRA User Management, you need to prepare JIRA and configure a specific user/password pair on it so that Bitbucket Server can get connected for User Management purposes. In this case, the password being sent on the connection request from Bitbucket Server to JIRA does not match what JIRA is expecting which causes the exception above to be thrown in Bitbucket Server logs.

This can also caused by the following bug (second stack trace): BSERV-4676 - Possible to save a JIRA User Directory with wrong Application name and/or Application password

Please refer to it in order to reproduce this use case.

Resolution

  • Please review the step "1. Set up JIRA to allow connections from Bitbucket Server" described in the Delegate user management to Jira document. Check that the username and password pair you created for Bitbucket Server is correct.

Making sure you remove/re-add JIRA as User management to your Bitbucket Server instance will help you troubleshoot if the user/password is incorrect wither in JIRA or Bitbucket Server.

Last modified on Feb 19, 2025

Was this helpful?

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