Subtasks and/or parent tasks of Issues show a null pointer exception error in Jira Data Center

Still need help?

The Atlassian Community is here for you.

Ask the community

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

The linked subtask panel shows an error instead of loading the subtask.

This can occur after a migration from Jira Cloud to Jira Datacenter, or for other reasons. 

(info) There is a sequence value which determines the order in which the subtasks for an issue should display.  A sequence of nulls causes an error.  Any numeric values will resolve the problem, including all zeros.

  • the sequence value is for showing what order to display the subtasks
    • A 0 will show the link first, with a "1."
    • A 1 will show the link second, with "2."
    • A null causes a failure.
    • Setting two subtasks with the same source value to have the same sequence value, like 0, will cause an arbitrary load order.
  • Unlike most database edits, this info is read live;
    • No restart is required for these changes to take effect.

Environment

Jira Datacenter 8.20.6
(Known to occur after migration from Jira Cloud)

Diagnosis

(error) Subtasks don't show, and there is an error/stack trace instead: 

Subtasks don't display (sequence null)

(tick) Subtasks should show up in a numbered list:

Error message in the subtask panel (excerpt)

An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. 
Details: ------- org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHtml' in class com.atlassian.jira.web.component.subtask.SubTaskSequenceColumnLayoutItem
 threw exception java.lang.NullPointerException: null value in entry: actualSequence=null at templates/jira/issue/table/macros.vm[line 117, column 34] at
 org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:337) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:284) at 
...
com.atlassian.velocity.htmlsafe.introspection.UnboxingMethod.invoke(UnboxingMethod.java:28) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270) ... 473 more


(info) Below queries are written for Postgres and may need revision for other database systems.

Specific Link Type and Issue

  1. Confirm the ID for the sub-task link:

    SELECT * FROM issuelinktype WHERE linkname = 'jira_subtask_link';

    (info) It is expected the ID will be 10100.  This will be assumed in the following steps.

  2. Confirm the ID for an affected Issue:
    1. Get the Issue ID

      1. Either Get the Issue ID from the interface

      2. Or get the Issue ID using the Project Key & Issue Key (replace KEY & 1234 below):

        SELECT jiraissue.id
        FROM jiraissue
        JOIN project ON jiraissue.project = project.id
        WHERE project.pkey = 'KEY' AND jiraissue.issuenum = 1234;
    2. Confirm that the sequence is null for that Issue (replace sourceID below):

      select * from issuelink where linktype = 10100 and SOURCE = sourceID;

      (info) If the sequence values returned are null, then the solution below will help.

General Subtask/Parent check

  1. See if any Subtask/Parent links are null, which none should be.  If you have a problem with another linktype, please use the specific instructions above.

    SELECT count(*) FROM issuelink WHERE linktype = 10100 AND sequence IS NULL; 

Cause

  • There are null values in the sequence column of the issuelink table.
  • This has been observed in Instances migrated from Jira Cloud to Jira DC.
    • null values inserted by other means can also cause this problem.

Solution

  1.  Please make a native database backup before modifying the database.
  2. Run the following query, to fill the nulls with 0s:

    UPDATE issuelink SET sequence = 0 WHERE linktype = 10100 AND sequence IS NULL;
  3. Test the Issue page; the solution should take effect immediately.



Last modified on Nov 18, 2024

Was this helpful?

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