-
Bug
-
Resolution: Fixed
-
Low
-
5.0.0, 5.1.0, 5.1.1, 5.2.0, 5.3.0, 5.4.0, 5.3.1, 5.4.20
-
4
-
Severity 3 - Minor
-
7
-
Issue Summary
When running objectschema export it will create a zip file with data about the object schema and for every objecttype it will create a file containing the data towards the objects.
If an objecttype has no objects it creates an empty file instead of a file containing one line with the attributes for this objecttype.
This will lead to an error when trying to use this zip file for an import.
This happens with Jira Service Management 5.0 and later as well as with the Marketplace plugin version 8.10.4 and later
This is reproducible on Data Center: (yes)
Steps to Reproduce
- Have an objectschema that has objecttypes with objects, but also at least one objecttype without any object
- Go to Assets -> Configure -> Import/Export
- Select Object Schema Export
- Give a name for the file and select the object schema
- Select Object schema with objects
- Run the export
Expected Results
The exported file can be used for object schema import with objects on same or different instance with same version of Jira/Assets.
There are no files of zero byte size.
Actual Results
For every objecttype without object there is a zero byte size csv file.
On import (with objects) you see error
The import might be incomplete.
The below exception is thrown in the insight_objectschema_import.log file:
2022-11-25 09:36:29,658 [insight-InsightThreadGroup-worker-thread-5] | Importing object for object type: Host, id 108, and attribute size: 4 2022-11-25 09:36:29,659 [insight-InsightThreadGroup-worker-thread-5] | Error when importing object schema and objects, object schema id: 7 java.lang.NullPointerException at java.base/java.util.Objects.requireNonNull(Objects.java:221) at java.base/java.util.Arrays$ArrayList.<init>(Arrays.java:4323) at java.base/java.util.Arrays.asList(Arrays.java:4310) at com.riadalabs.jira.plugins.insight.services.imports.schema.ObjectSchemaImportServiceImpl.importObjects(ObjectSchemaImportServiceImpl.java:1394)
Checking on the csv files inside the export (zip) file you see one or more files with zero bytes
Workaround
You can fix the import by removing the offending empty files from the zip file. To do this use the following steps:
- Unzip the exported objectschema file
- remove all csv files that are empty (zero byte size)
- zip the remaining files again
- use the newly created zip file for the import
KB Article Assets: Using objectschema import to import schema and objects fails with java.lang.NullPointerException has been created for this