How to delete a linked article when it either doesn't exist or is read-only in Confluence
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
Within Jira Service Management, a linked Confluence Knowledge Base that is inaccessible or missing can't be deleted. This may happen if a Jira project is migrated via Configuration Manager for Jira, for example, from one instance to another where the Confluence link is not accessible.
環境
Jira Service Management 5
診断
Root Cause 1: When trying to unlink/delete the Knowledge Base within JSM, the user will see an error in the user interface stating "We couldn't unlink the [space name] space. Refresh the page and try again. If this keeps happening, contact your Jira admin.". Within the atlassian-jira.log the following error may be present:
https-openssl-nio-443-exec-26 url: /rest/servicedesk/knowledgebase/1/articles/search-limit; user: [username] ERROR [username] 999x164878x2 uvubi9 7.20.53.159 /rest/servicedesk/knowledgebase/articles/search-limit [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: null
java.util.NoSuchElementException
Root Cause 2: We have seen some scenarios in which the Confluence instance that hosts the linked KB is set to read-only mode, Within the atlassian-jira.log the following error may be present, similar to root cause 1:
http-nio-8080-exec-8 url: /rest/servicedesk/knowledgebase/1/articles/search-limit; user: [username] ERROR [username] 874x12276890x3 e6l769 10.8.140.154,10.213.150.20 /rest/servicedesk/knowledgebase/1/articles/search-limit [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: null
java.util.NoSuchElementException: null
ソリューション
Solution for Root cause 1: In events like this the Knowledge Base can be manually deleted via the database using the following procedure:
- First get the Service Desk project ID:
select p.pname, sd."ID" as "sd_id" from public."AO_54307E_SERVICEDESK" sd inner join project p on p.id = sd."PROJECT_ID";
- You may need to delete content from a few tables with key constraints (these tables may also not have any content depending on how the KB Space was used. But if there data in these tables it needs to be cleared out). We will use the "sd_id" column returned in the first query to run the following delete statements:
delete from public."AO_54307E_CONFLUENCEKBENABLED" where "SERVICE_DESK_ID" = <sd_id>;
delete from public."AO_54307E_CONFLUENCEKBLABELS" where "SERVICE_DESK_ID" = <sd_id>;
- Finally you will use the "sd_id" column returned in the first query to run the following delete statement to remove the KB link:
delete from public."AO_54307E_CONFLUENCEKB" where "SERVICE_DESK_ID" = <sd_id>;
- After completing this step, refresh the page to ensure that the space has been unlinked. If the space is still present, restart Jira. This should remove the Knowledge Base from the project.
NOTE: When performing manual database modification it is critical to ensure that there is a database back up in case a rollback is needed.
Solution for Root cause 2: Temporarily remove the read-only mode from Confluence instance, unlink the KB space and set the Confluence to read-only mode again.