Creating or deleting issues in Jira fails with NullPointerException

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

A NullPointerException error is thrown when trying to create or delete issues:


Environment

Any Jira version.

Diagnosis

A stacktrace similar to the following may be thrown in the UI when trying to delete an issue:

java.lang.NullPointerException
java.lang.NullPointerException
	at com.atlassian.jira.issue.IssueFactory$1.transform(IssueFactory.java:79)
	at org.apache.commons.collections.CollectionUtils.collect(CollectionUtils.java:632)
	at org.apache.commons.collections.CollectionUtils.collect(CollectionUtils.java:610)
	at org.apache.commons.collections.CollectionUtils.collect(CollectionUtils.java:575)
	at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssueObjects(DefaultIndexManager.java:362)
	at com.atlassian.jira.issue.index.DefaultIndexManager.reIndex(DefaultIndexManager.java:382)
	at com.atlassian.jira.issue.index.DefaultIndexManager.reIndex(DefaultIndexManager.java:375)
	at sun.reflect.GeneratedMethodAccessor1258.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.atlassian.util.profiling.object.ObjectProfiler.profiledInvoke(ObjectProfiler.java:83)
	at com.atlassian.jira.config.component.SwitchingInvocationHandler.invoke(SwitchingInvocationHandler.java:28)
	at com.sun.proxy.$Proxy131.reIndex(Unknown Source)
	at com.atlassian.jira.issue.link.DefaultIssueLinkManager.reindexLinkedIssues(DefaultIssueLinkManager.java:149)
	at com.atlassian.jira.issue.link.DefaultIssueLinkManager.removeIssueLinkInternal(DefaultIssueLinkManager.java:240)


The following WARN/ERROR messages appear in the atlassian-jira.log:

2015-08-15 21:37:52,193 http-bio-9002-exec-21 WARN xxx 1297x29965x1 yyy 10.28.0.12,127.0.0.1 /browse/BGBD-65 [jira.issue.link.LinkCollectionImpl] Issue [id=29010] links to a non-existing issue!
...
2015-08-15 21:38:12,302 http-bio-9002-exec-42 ERROR xxx 1298x30005x1 yyy 10.28.0.12,127.0.0.1 /secure/QuickCreateIssue.jspa [jira.quickedit.action.QuickCreateIssue] java.lang.NullPointerException
java.lang.NullPointerException
	at com.atlassian.jira.issue.link.DefaultIssueLinkManager.getIssueLink(DefaultIssueLinkManager.java:493)
	at com.atlassian.jira.issue.link.DefaultIssueLinkManager.createIssueLink(DefaultIssueLinkManager.java:101)

Cause

This is a data integrity issue. There may be some issue links pointing to non-existent Jira issue IDs in the database.

Solution

This can be fixed by running Jira's Database Integrity Checker:

  • Navigate to Jira Administration > System > SYSTEM SUPPORT > Integrity checker
  • Ensure that all options under 'Check Issue Relations' are selected, and then click the 'Check' button.
  • Click on 'Fix' to fix all the errors found.

Last modified on Nov 19, 2024

Was this helpful?

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