Re-Indexing in Jira fails with "Assertions$NullArgumentException: label should not be null!" error message

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

Summary

Full Re-Indexing in Jira fails after 99% of completion with no errors on the UI screen (Re-Indexing page). In the logs, indexing fails with error message Assertions$NullArgumentException: label should not be null!.

Environment

  • v8.x and higher.

Diagnosis

  • When a user triggers Re-Indexing, indexing fails after 99% with errors.  Based on details from Re-indexing page, the error occurs while indexing for PortalPage is in progress.
  • No error logs are noticed preceding or after the indexing process for SearchRequest and PortalPage
  • In the Re-indexing logs, the below errors are noticed when Indexing has completed 89%, Assertions$NullArgumentException: label should not be null! error message is observed.

    2023-11-01 03:11:36,293-0700 IssueIndexer:thread-5 INFO ***** 142x345x1 /secure/admin/IndexReIndex!reindex.jspa [c.a.j.w.a.admin.index.IndexAdminImpl] Re-indexing is 89% complete. Current index: Issue
    2023-11-01 03:11:59,570-0700 IssueIndexer:thread-33 WARN ***** 142x345x1 /secure/admin/IndexReIndex!reindex.jspa [c.a.jira.index.AccumulatingResultBuilder] com.atlassian.cache.CacheException: com.atlassian.jira.util.dbc.Assertions$NullArgumentException: label should not be null!
    java.lang.RuntimeException: com.atlassian.cache.CacheException: com.atlassian.jira.util.dbc.Assertions$NullArgumentException: label should not be null!
    	at com.atlassian.jira.index.DefaultIndex$Failure.<init>(DefaultIndex.java:100)
    	at com.atlassian.jira.issue.index.DefaultIssueIndexer$EntityOperation.lambda$perform$6(DefaultIssueIndexer.java:858)
    	at com.atlassian.jira.issue.index.DefaultIssueIndexer$EntityOperation$$Lambda$5510/474313968.accept(Unknown Source)
    	at java.util.HashMap.forEach(HashMap.java:1280)
    	at com.atlassian.jira.issue.index.DefaultIssueIndexer$EntityOperation.perform(DefaultIssueIndexer.java:858)
    	at com.atlassian.jira.issue.index.DefaultIssueIndexer.lambda$processBatch$2(DefaultIssueIndexer.java:334)
    -----------------
    om.atlassian.jira.issue.customfields.impl.LabelsCFType$LabelCustomFieldProvider.getCustomFieldInfo(LabelsCFType.java:457)
    	at com.atlassian.jira.issue.index.managers.NonNullCustomFieldProviderWithStats.getCustomFieldInfo(NonNullCustomFieldProviderWithStats.java:54)
    	at 
    --------------------
    at com.atlassian.jira.issue.label.OfBizLabelStore$GenericValueToLabel.apply(OfBizLabelStore.java:155)
  • Further review of stack traces suggests that Jira is trying to gather some information from the custom field or the label field has a NULL entry in the database or a custom field of "labels" type has a NULL entry in the database.

Cause

Whenever a new label is created at issue level, a new row will be added to the database table label. The database table label, has a column label which contains the name of the label. In some cases, for unknown reasons, certain NULL entries are stored for some label fields in label column. Due to this NULL entry, Re-Indexing failure occurs. Updating the label column with 'NON NULL' values should help resolve the Re-indexing issue.

Solution

  • Identify the rows with NULL entries in label DB table by running the below DB commands separately against the Database. 

    select * from label where label is null; 
  • If the DB contains NULL entries in the "label" column, we will get the below output. There can be multiple rows with NULL values.

    ID    FIELDID  ISSUE   LABEL
    ----- -------- ------- ----------
    34027 (null)   95907   (null)
    46117 (null)   129922  (null)     
     
  • If there are 2 rows with NULL entries, we need to run the UPDATE  command to update non-null values.
    1. Stop the Jira application.
    2. Run the below DB commands against your database.

      UPDATE label SET label='test' WHERE id=34027 and issue=95907;
      ------------------
      UPDATE label SET label='test' WHERE id=46117 and issue=129922;
    3. Run the below queries again to make sure the DB rows are updated and there are no NULL values.

      select * from label WHERE id=34027 and issue=95907;
      ---------------------
      select * from label WHERE id=46117 and issue=129922;
      ---------------------
      select * from label where label is null;
    4. Clear the plugin cache files by following the steps mentioned in How to clear Jira's plugin cache page.
    5. Restart the Jira application.

  • Once the application is up, please try performing "Full Re-indexing" of the Jira application

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.

Last modified on Dec 28, 2023

Was this helpful?

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