Unable to import objects for object type X with id X due to null value encountered - Insight Schema import

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

Problem

While attempting to import an Insight Schema, you may find many objects not being imported on the target.

The following appears in the insight_objectschema_import. log

2021-10-14 15:14:08,918 [insight-InsightThreadGroup-worker-thread-1] | Unable to import objects for object type AD User 1 with id 19 due to null value encountered on line 2 on column 6
2021-10-14 15:14:08,918 [insight-InsightThreadGroup-worker-thread-1] | Invalid reference found, object key from export: ITSM-19
2021-10-14 15:14:08,918 [insight-InsightThreadGroup-worker-thread-1] | Finished object key lookup for objectId: 24, reference objects length: 1
2021-10-14 15:14:08,918 [insight-InsightThreadGroup-worker-thread-1] | No valid references for attribute type 107


Environment

All Insight versions

Cause

In the source instance, at some point, some attributes were  required after objects were already created. Therefore some of the objects may not have those attributes populated.

  • Their Cardinality value to minimum 1.

This doesn't break any existing objects, but if you try to edit them in the Source then they will display an error until those values are populated. 


If one object fails, it does not continue for next rows on the same Object Type csv file leading to an incomplete import on target. 

It is a known behavior that is being tracked in the bug report  JSDSERVER-10800 - Getting issue details... STATUS



Diagnosis

You need to identify what objects are invalid on the source to import them successfully later on the target. To do so, let's have a look at the following example as it will be helpful to go through the troubleshooting steps.

Source instance

  • Object Types, at this point, none of the attributes are required except the Object Name.

  • Some objects are already created.
  • On Object Type "AD User 1", set Cardinality value to minimum 1.


  • Some other "AD User" objects will be created and they will have the 'UserId' attribute required. 


  • The schema export will succeed.
  • After the Schema import we observed that few objects were missing on the target.

Resolution

1. The following appears in the insight_objectschema_import. log. 

2021-10-14 15:14:08,918 [insight-InsightThreadGroup-worker-thread-1] | Invalid reference found, object key from export: ITSM-19
2021-10-14 15:14:08,918 [insight-InsightThreadGroup-worker-thread-1] | No valid references for attribute type 107

2.   In the target instance, locate the Object Type attribute 107. In our case, attribute 'Member'.

3.  The attribute 'Member' has an Outbound reference to "AD User 1" Object Type.

4.  Unzip the Schema export, open the schema.xml file and search for 'AD User 1'. This will give you the csv file ID. In this example it is 15.

<id>15</id><name>AD User 1</name>

5.  In the Schema export directory, open the file 15.csv.

6.  You will need to fix all objects where the required attributes (UserId in this case) are empty. This can be done either:

  1. In the source instance, ensure that every object has a value for those required attributes. After that, you can export the schema again.
  2. Open the csv file as text and remove those objects that are no longer needed. After that, you can import the schema again.




Last modified on Oct 14, 2021

Was this helpful?

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