How to Fix Unable to Remove Old DVCS Connections in Jira After 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

Scenario 1

If you happened to have had a previous DVCS connection that linked your JIRA instance to a Bitbucket Cloud instance, you might not be able to remove this link from within JIRA if the Bitbucket Cloud account has already been disabled. Within JIRA you can be prompted to try to reset the OAuth, however since the BitBucket Cloud instance has been shutdown/disabled, this isn't possible to complete successfully through JIRA.

Scenario 2

In the application-jira.log, you are getting the following error message when accessing the DVCS configuration page:

com.atlassian.cache.CacheException: java.lang.IllegalArgumentException: Credential PRINCIPAL_ID is not supported for Bitbucket Cloud.

Diagnosis

When attempting to delete a DVCS account, the operation fails and the account remains visible. Debug logs may show that a job for account or organization deletion already exists, indicating a stuck or incomplete scheduled job. Running a SQL query on the clusteredjob table often reveals that the next_run column is empty for the problematic job, confirming a database inconsistency. Deleting the corresponding job record from the database allows the removal process to complete successfully

Cause

  • The issue appears to happen when the Bitbucket Cloud instance has been shutdown or disabled. Due to this, JIRA can no longer reset the OAuth validation or communicate with that Bitbucket instance.

  • Upgrading Jira from 7.x to 8.x or the latest version. The upgrade caused the latest DVCS connector to reject the old credentials from the Bitbucket Cloud.

Solution

Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

  • Run the following SQL command in order to determine what DVCS links exist in your environment:

SELECT * FROM "AO_E8B6CC_ORGANIZATION_MAPPING";

  • Which should return something like this:

ACCESS_TOKEN

ADMIN_PASSWORD

ADMIN_USERNAME

APPROVAL_STATE

AUTOLINK_NEW_REPOS

DEFAULT_GROUPS_SLUGS

DVCS_TYPE

HOST_URL

ID

NAME

OAUTH_KEY

OAUTH_SECRET

PRINCIPAL_ID

xxxx

null

null

APPROVED

0

null

bitbucket

https://bitbucket.org

2

<Instance_name>

xxxxxx

xxxxxx

xxxxxx

  • Run the following SQL query to remove the records in AO_E8B6CC_ORGANIZATION_MAPPING table:

delete from "AO_E8B6CC_ORGANIZATION_MAPPING" WHERE "HOST_URL"='https://bitbucket.org';

  • You might have to restart JIRA once more.

  • You can reconfigure the same DVCS configuration to resync all the old data back after being able to access the DVCS page.

Updated on June 2, 2025

Still need help?

The Atlassian Community is here for you.