Assets: Object no longer available after deleting Confluence application link
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
When trying to access an object or the attributes of an object type you receive a blank page and the error message:
Something went wrong with your search. Your filters have been reset. Please try again.
Something went wrong. Contact administrator
Environment
All Jira versions and all Confluence versions
Diagnosis
In the atlassian-jira.log the following error can be found
2024-03-25 13:02:33,718+0000 http-nio-8080-exec-121 url: /jira/rest/insight/1.0/objecttype/37/attributes; user: admin ERROR admin 782x1689x1 11d5l24 172.29.222.249,172.50.0.2 /rest/insight/1.0/objecttype/37/attributes [c.r.j.p.i.c.w.a.r.exception.mapper.DefaultMapper] Unexpected exception was thrown while processing the request
java.lang.NullPointerException
at com.riadalabs.jira.plugins.insight.channel.web.api.rest.services.documentation.DocumentationAssemblerInJira.assembleDocumentationPageAttribute(DocumentationAssemblerInJira.java:92)
at com.riadalabs.jira.plugins.insight.channel.web.api.rest.services.objecttypeattribute.ObjectTypeAttributeAssemblerBase.assembleObjectTypeAttributeEntry(ObjectTypeAttributeAssemblerBase.java:104)
at com.riadalabs.jira.plugins.insight.channel.web.api.rest.services.objecttype.ObjectTypeResource.findObjectTypeAttributes(ObjectTypeResource.java:627)
at jdk.internal.reflect.GeneratedMethodAccessor1114.invoke(Unknown Source)
Cause
A Confluence Application Link has been removed, although there are objects with attributes pointing to a Confluence Space on that instance. See also JSDSERVER-15205 - Assets: Accessing objects and object type attributes leads to NullPointerException when Confluence Application Link is removed.
Solution
To fix this you need to either repair/recreate the application link to the Confluence Instance in question. If that is not possible, the attribute on the object ID will need to be removed.
The following database queries have been tested with PostgreSQL. If you are using a different database, please check with your DB Admin to adjust to your Setup
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
For this you can use either of the following steps:
- The objecttype ID can be found in the error message in the atlassian-jira.log file or as part of the URL, see Assets (formerly Insight): How to get the IDs of object schema, object type and object from the Jira User Interface. In the example from the Diagnosis this is 37
Run the following database query to get all attributes of this object type
select "ID", "NAME", "OBJECT_TYPE_ID", "TYPE_VALUE", "CREATED" from "AO_8542F1_IFJ_OBJ_TYPE_ATTR" where "OBJECT_TYPE_ID" = <object_typeID>;
The output will look similar to this
|ID |NAME |OBJECT_TYPE_ID|TYPE_VALUE |CREATED | |-----|------------------|--------------|------------------------------------|-----------------------| |236 |Key |37 | |2021-04-23 13:00:29.233| |238 |Created |37 | |2021-04-23 13:00:29.238| |239 |Updated |37 | |2021-04-23 13:00:29.240| |237 |Name |37 | |2021-04-23 13:00:29.235| |494 |Status |37 | |2021-04-23 13:00:32.433| |496 |Location Placement|37 | |2021-04-23 13:00:32.460| |497 |Quota |37 | |2021-04-23 13:00:32.466| |498 |Spending Limit |37 | |2021-04-23 13:00:32.472| |495 |Id |37 | |2021-04-23 13:00:32.444| |1,249|info |37 |85dceef5-feca-3983-943c-83b6d193b1d8|2024-02-26 13:04:37.927|
Identify the attribute, that points to the Confluence pages. In this example the attribute is called Info with the
attributeID being 1249
- Remove the attribute in question by either
Rest API using the call
DELETE <JiraBaseIRL>/rest/assets/1.0/objecttypeattribute/<attributeID>
- Database manipulation
- Stop Jira
Run the query
delete from "AO_8542F1_IFJ_OBJ_TYPE_ATTR" where "ID"= <attributeID>
- Start Jira
- After the change run a clean reindex for Assets (see also Configuring global Jira settings)