JIRA NullPointerException While Opening Existing Issue
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
:
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:
SELECT * FROM jiraissue where pkey='<issue_key>';
- Check the issue 'issuestatus' ID, for e.g 10000
Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.
Change the ID to 1 which matches to 'Open' status:
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 - JRA-19556Getting issue details... STATUS for details.