Incorrect Bitbucket URL displayed in Jira Cloud after creating Bitbucket Server staging environment from production
プラットフォームについて: Cloud、Server、および Data Center - この記事はすべてのプラットフォームに等しく適用されます。
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.
*Fisheye および Crucible は除く
要約
A Bitbucket staging instance is created using this document which has the Bitbucket Production data (both Database and Filesystem). After preparing the Bitbucket staging instance, the Bitbucket staging instance is integrated with the Jira Cloud by creating a Tunneled application link. The application links are in Connected status.
After authorizing the Jira cloud URL from the user account in Bitbucket, navigating to Manage account (by clicking your avatar on the top right corner and selecting Manage account) >> Authorized applications >> Outgoing and then clicking on the Authorize button, the Jira Cloud page (<your-org>.atlassian.net/plugins/servlet/oauth/users/access-tokens) displays incorrect URL (Bitbucket production URL) instead of the Bitbucket staging URL.
環境
- Bitbucket Datacenter 8.9.3 (may be applicable for other supported versions of Bitbucket)
- Jira Cloud
診断
- Verify the Bitbucket
Base URL
while creating the tunneled application links and confirm if the URL provided while creating the tunneled application links is theBase URL
of the Bitbucket staging instance. Run the below query against the both Bitbucket production and staging database and verify if the entries are the same:
select * from plugin_setting where key_name like '%com.atlassian.oauth.consumer.ConsumerService%';
原因
Jira Cloud gets the Bitbucket Base URL
from Bitbucket's plugin_setting
table (key_name - com.atlassian.oauth.consumer.ConsumerService:host.__HOST_SERVICE__
) while creating the tunneled application link and shown on the Connected apps page (<your-org>.atlassian.net/plugins/servlet/oauth/users/access-tokens). When the production database is refreshed to the Bitbucket staging table, the record key_name -
com.atlassian.oauth.consumer.ConsumerService:host.__HOST_SERVICE__
contains the Bitbucket Production URL causing the issue.
ソリューション
Please take a full backup of the table/database of the Bitbucket staging instance before performing the steps
- Shutdown Bitbucket staging instance
Run the below query on the Bitbucket staging instance to verify if we're aiming at 1 record which is
ConsumerService:
select * from plugin_setting where key_name like '%com.atlassian.oauth.consumer.ConsumerService:host.__HOST_SERVICE__%';
Delete the record by running the query:
delete from plugin_setting where key_name like '%com.atlassian.oauth.consumer.ConsumerService:host.__HOST_SERVICE__%';
During the process of creating of application link, Bitbucket automatically creates the record (if not present) with the current instance setup.
Verify if the record is deleted. The below query should return 0 records:
select * from plugin_setting where key_name like '%com.atlassian.oauth.consumer.ConsumerService:host.__HOST_SERVICE__%';
- Start Bitbucket staging instance
- Delete application tunnel from admin.atlassian.com and tunneled application links from both Bitbucket and Jira Cloud
- Re-create the application tunnel and tunneled application link between Bitbucket and Jira Cloud
- Authorise the Jira Cloud application from Bitbucket
- Verify if the Connected apps page shows the right URL