Reindexing JIRA causes a Nullpointer Error

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

The following appears in the atlassian-jira.log:

Caused by: java.lang.NullPointerException
at com.atlassian.greenhopper.manager.issuelink.EpicLinkManagerImpl.getEpic(EpicLinkManagerImpl.java:101)
at com.atlassian.greenhopper.customfield.epiclink.EpicLinkCFType.getValueFromIssue(EpicLinkCFType.java:77)
at com.atlassian.jira.issue.fields.CustomFieldImpl.getValue(CustomFieldImpl.java:381)
at com.atlassian.greenhopper.customfield.epiclink.EpicLinkCustomFieldIndexer.addIndex(EpicLinkCustomFieldIndexer.java:41)

Cause

The cause may vary but a known cause is reindexing following the addition of a 'custom field' when a user is using greenhopper.

Resolution

Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.

1. Run the integrity checker: Using the Database Integrity Checker

2. Try to Re-index JIRA again.  

3. If re-indexing still fails, then continue on with the next steps. Please run the following query on the JIRA DB:

SELECT * FROM issuelink WHERE SOURCE NOT IN (SELECT ID FROM jiraissue);

4. If the previous query returns a result, then:

  • Shutdown JIRA
  • Execute the following query on the DB

     

    DELETE FROM issuelink WHERE SOURCE NOT IN (SELECT ID FROM jiraissue);
  • Restart JIRA
  • Manually perform a re-indexing

5. If re-indexing stil fails, then:

  • Run the command
select * from jiraissue where issuetype is null;
  • If this returns any rows, then please find an appropriate issuetype for the issue key returned in the previous query. For this we run: 
select * from issuetype;
  • Once the id of the issue type if identified, run the below sql:
update jiraissue set issuetype = <<id found from the above query>> where id = <<jira issue id found in the first query>>
Last modified on Nov 2, 2018

Was this helpful?

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