Jira throws Assertions$NullArgumentException: item should not be null!
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs 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
While migrating from Jira Cloud to Jira Data Center, you may face the following errors while restoring the XML Backup, which can cause an issue with Custom Fields.
Environment
Jira Data Center on any version from 9.12.0
Diagnosis
Check the atlassian-jira.log
file and look for the error below:
1
2
3
4
ERROR [c.a.j.web.servlet.InternalServerErrorServlet] {errorId=e7d133c6-a376-46ee-8abe-a07b49da49ee, interpretedMsg=, cause=com.atlassian.jira.util.dbc.Assertions$NullArgumentException: item should not be null!, stacktrace=com.atlassian.jira.util.dbc.Assertions$NullArgumentException: item should not be null!
at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:25) [jira-api-9.12.5.jar:?]
at com.atlassian.jira.config.managedconfiguration.DefaultManagedConfigurationItemService.doesUserHavePermission(DefaultManagedConfigurationItemService.java:100) [classes/:?]
at com.atlassian.jira.web.action.admin.customfields.EditCustomField.isFieldLocked(EditCustomField.java:87) [classes/:?]
ℹ️ This Error is saying that an ITEM is null.
If you find this error, then this KB article is relevant and you can move on to the Resolution steps.
Cause
Some rows in the the managedConfigurationitem
table are missing a value for the item_type
column.
Solution
Resolution
The resolution steps will consist in updating all the rows in the managedConfigurationitem
table that are missing a value for the item_type
column.
Warning
Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.
The resolution steps are as follows:
Verify that there are rows with missing values in the
managedConfigurationitem
tableRun the SQL query below to verify that there are rows that are missing values. This query will return all rows where the
item_type
field is missing a value. If the query below return at least 1 result, move on to the next step:1
select * from managedConfigurationitem where item_type is null;
Fix the rows
To update the rows with missing
item_type
values, run the following SQL command (⚠️ Make sure to backup your database before running this query). This command sets theitem_type
toCUSTOM_FIELD
for all rows where it was previouslyNULL
:1 2 3
UPDATE managedConfigurationitem SET item_type = 'CUSTOM_FIELD' WHERE item_type IS NULL;
Verify that all rows have been correctly updated
Run the query again to ensure no rows have a
NULL
value in theitem_type
field. If this query returns no results, all missing values have been successfully updated:1
select * from managedConfigurationitem where item_type is null;
Restart the Jira application
A restart of the Jira application is required for the database updates to be taken into account and loaded in the Jira data cache
Was this helpful?