How to delete a linked article when it either doesn't exist or is read-only in Confluence

 

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

 

Summary

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.  

Environment

Jira Service Management 5

Diagnosis

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

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.


(warning) 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.


Last modified on Jan 3, 2025

Was this helpful?

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