JIRA NullPointerException While Opening Existing Issue
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
Symptoms
While opening an issue in JIRA, the page throws an error with a NullPointerException stack in the details.
The following appears in the atlassian-jira.log
:
1
2
3
4
5
6
7
8
9
10
11
12
2013-10-04 10:02:39,241 ajp-bio-8009-exec-1056 ERROR xxxx 602x765207x1 xxxxx xx.xxx.xxx.xx /issues/ [com.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: java.lang.NullPointerException
java.lang.NullPointerException
at com.atlassian.jira.workflow.OSWorkflowManager.isEditable(OSWorkflowManager.java:1153)
at com.atlassian.jira.issue.managers.DefaultIssueManager.isEditable(DefaultIssueManager.java:465)
at com.atlassian.jira.issue.managers.DefaultIssueManager.isEditable(DefaultIssueManager.java:471)
at com.atlassian.jira.issue.fields.LabelsSystemField.getColumnViewHtml(LabelsSystemField.java:314)
at com.atlassian.jira.issue.fields.layout.column.ColumnLayoutItemImpl.getHtml(ColumnLayoutItemImpl.java:139)<+2>
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:381)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:370)
at com.atlassian.velocity.htmlsafe.introspection.AnnotationBoxingMethod.invoke(AnnotationBoxingMethod.java:26)
...
Cause
The problem is be caused by the following items:
The SimpleWorkflowManager.isEditable or OSWorkflowManager.isEditable JIRA APIs can throw a NPE when called with an issue without a status. The most common way for this to occur is for a custom field to call this method during creation (i.e. before the issue is associated with a workflow). For example, the supporttools (i.e. NullCFType) field from the JIRA Toolkit plugin does this.
The problematic issue has different values in the issuestatus id in the jiraissue table.
Workaround
Step 1
Please try the following workaround:
Delete the Support Tools Bar custom field under Administration > Custom Fields.
Disable the Support Tool Bar supporttools module under Administration > Plugins > JIRA Toolkit Plugin > expand the modules enabled section
ℹ️ If disabling of the field can cause critical impact to your business, we recommend to test it in staging environment first.
If the problem still there, proceed to Step 2.
Step 2
Execute the below SQL in the JIRA database:
1
SELECT * FROM jiraissue where pkey='<issue_key>';
Check the issue 'issuestatus' ID, for e.g 10000
Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Change the ID to 1 which matches to 'Open' status:
1
UPDATE jiraissue SET issuestatus='1' where pkey='<issue_key>';
Restart JIRA and check if this resolves the issue.
Additionally run Integrity Checker and fix any errors reported.
Resolution
This bug is resolved in the latest version of JIRA (>= 5.2.8). Please refer to JRASERVER-19556 - The 'SimpleWorkflowManager.isEditable' method can throw a NPE when called with an issue without a status for details.
Was this helpful?