Reindexing JIRA causes a Nullpointer Error
The following appears in the
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)
The cause may vary but a known cause is reindexing following the addition of a 'custom field' when a user is using greenhopper.
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>>