Searching for issues in the Issue Navigator throws NullPointerException in Jira Server or Data Center
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
Problem
While searching for issues in the Issue Navigator, it returns NullPointerException (NPE). This could also happen when you are navigating through the search result pages, or in dashboard gadgets.
The following appears in the atlassian-jira.log
2016-12-27 09:33:01,070 http-nio-8724-exec-15 ERROR admin 573x303x1 1u1n6ts 10.60.3.51 /rest/issueNav/1/issueTable [c.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: java.lang.NullPointerException
java.lang.NullPointerException
at com.atlassian.jira.issue.fields.SummarySystemField.populateVelocityParams(SummarySystemField.java:71)
at com.atlassian.jira.issue.fields.AbstractTextSystemField.getColumnViewHtml(AbstractTextSystemField.java:59)
at com.atlassian.jira.issue.fields.layout.column.ColumnLayoutItemImpl.getHtml(ColumnLayoutItemImpl.java:106)
at sun.reflect.GeneratedMethodAccessor299.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:385)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:374)
at com.atlassian.velocity.htmlsafe.introspection.AnnotationBoxingMethod.invoke(AnnotationBoxingMethod.java:26)
at com.atlassian.velocity.htmlsafe.introspection.UnboxingMethod.invoke(UnboxingMethod.java:30)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:507)
at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.directive.Foreach.performIteration(Foreach.java:393)
at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:316)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:212)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:247)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.apache.velocity.Template.merge(Template.java:328)
at org.apache.velocity.Template.merge(Template.java:235)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:381)
at com.atlassian.velocity.DefaultVelocityManager.writeEncodedBodyImpl(DefaultVelocityManager.java:117)
at com.atlassian.velocity.DefaultVelocityManager.writeEncodedBody(DefaultVelocityManager.java:97)
at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.toWriterImpl(DefaultVelocityTemplatingEngine.java:122)
at com.atlassian.jira.template.velocity.DefaultVelocityTemplatingEngine$DefaultRenderRequest.asHtml(DefaultVelocityTemplatingEngine.java:113)
at com.atlassian.jira.web.component.AbstractWebComponent.asHtml(AbstractWebComponent.java:44)
at com.atlassian.jira.web.component.IssueTableWebComponent$1.write(IssueTableWebComponent.java:160)
at com.atlassian.jira.web.component.IssueTableWebComponent.asHtml(IssueTableWebComponent.java:97)
at com.atlassian.jira.web.component.IssueTableWebComponent.getHtml(IssueTableWebComponent.java:70)
at com.atlassian.jira.web.component.IssueTableWebComponent.getHtml(IssueTableWebComponent.java:54)
at com.atlassian.jira.plugin.issuenav.service.issuetable.ListViewIssueTableCreator.getTable(ListViewIssueTableCreator.java:60)
at com.atlassian.jira.plugin.issuenav.service.issuetable.AbstractIssueTableCreator.create(AbstractIssueTableCreator.java:192)
at com.atlassian.jira.plugin.issuenav.service.issuetable.DefaultIssueTableService.createIssueTableFromCreator(DefaultIssueTableService.java:170)
at com.atlassian.jira.plugin.issuenav.service.issuetable.DefaultIssueTableService.getIssueTable(DefaultIssueTableService.java:268)
at com.atlassian.jira.plugin.issuenav.service.issuetable.DefaultIssueTableService.getIssueTableFromFilterWithJql(DefaultIssueTableService.java:115)
at com.atlassian.jira.plugin.issuenav.rest.IssueTableResource.getIssueTableHtml(IssueTableResource.java:99)
... 3 filtered
at java.lang.reflect.Method.invoke(Method.java:498)
Diagnosis
The Integrity Checker flags error(s) in regards to Issue Relations.
Cause
JIRA is trying to fetch the parent issue key to render the summary for a sub-task however the parent issue either doesn't exist or could not be retrieved. This leads to a NullPointerException while retrieving the result-set.
protected void populateVelocityParams(FieldLayoutItem fieldLayoutItem, Issue issue, Map<String, Object> params) {
super.populateVelocityParams(fieldLayoutItem, issue, params);
if (issue.isSubTask()) {
params.put("subTask", Boolean.TRUE);
Issue parentIssue = issue.getParentObject();
params.put("parentIssueKey", parentIssue.getKey());
params.put("subTaskParentIssueLinkDisabled", Boolean.TRUE);
if (getPermissionManager().hasPermission(Permissions.BROWSE, parentIssue, getAuthenticationContext().getUser())) {
params.put("parentIssueSummary", parentIssue.getSummary());
params.put("subTaskParentIssueLinkDisabled", Boolean.FALSE);
}
}
}
Resolution
- First, fix the error via Integrity Checker
- Then, run a full re-index.