Reindexing JIRA fails with nullPointerException
Symptoms
Reindexing JIRA fails with a nullPointerException.
The following appears in the atlassian-jira.log
:
2014-07-15 11:22:08,602 localhost-startStop-1 WARN [atlassian.jira.index.AccumulatingResultBuilder] Indexing failed for Issue - '35432'
2014-07-15 11:22:08,602 localhost-startStop-1 WARN [atlassian.jira.index.AccumulatingResultBuilder] com.atlassian.cache.CacheException: com.atlassian.cache.CacheException: com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
java.lang.RuntimeException: com.atlassian.cache.CacheException: com.atlassian.cache.CacheException: com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
at com.atlassian.jira.index.DefaultIndex$Failure.<init>(DefaultIndex.java:123)
at com.atlassian.jira.issue.index.DefaultIssueIndexer$IndexIssuesOperation.perform(DefaultIssueIndexer.java:521)
at com.atlassian.jira.issue.index.DefaultIssueIndexer$4$1.get(DefaultIssueIndexer.java:336)
at com.atlassian.jira.issue.index.DefaultIssueIndexer$4$1.get(DefaultIssueIndexer.java:332)
...
Caused by: com.atlassian.cache.CacheException: com.atlassian.cache.CacheException: com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
at com.atlassian.cache.memory.DelegatingCachedReference.get(DelegatingCachedReference.java:51)
at com.atlassian.jira.issue.index.managers.FieldIndexerManagerImpl.getAllIssueIndexers(FieldIndexerManagerImpl.java:92)
...
Caused by: com.atlassian.cache.CacheException: com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
at com.atlassian.cache.memory.DelegatingCachedReference.get(DelegatingCachedReference.java:51)
at com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager.getHelper(DefaultSearchHandlerManager.java:254)
at com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager.getAllSearchers(DefaultSearchHandlerManager.java:236)
...
Caused by: com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)
at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)
at com.atlassian.util.concurrent.ResettableLazyReference.get(ResettableLazyReference.java:92)
at com.atlassian.jira.issue.fields.CustomFieldImpl.getCustomFieldSearcher(CustomFieldImpl.java:1915)
at com.atlassian.jira.issue.fields.CustomFieldImpl.<init>(CustomFieldImpl.java:263)
...
Caused by: java.lang.NullPointerException
at com.atlassian.jira.util.JiraUtils.loadComponent(JiraUtils.java:97)
at com.atlassian.jira.util.JiraUtils.loadComponent(JiraUtils.java:92)
at com.atlassian.jira.issue.managers.DefaultCustomFieldManager.loadSearcher(DefaultCustomFieldManager.java:309)
at com.atlassian.jira.issue.managers.DefaultCustomFieldManager.getCustomFieldSearcher(DefaultCustomFieldManager.java:288)
at com.atlassian.jira.issue.fields.CustomFieldImpl$CustomFieldSearcherLazyRef.create(CustomFieldImpl.java:2225)
at com.atlassian.util.concurrent.ResettableLazyReference$InternalReference.create(ResettableLazyReference.java:182)
...
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
...
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
...
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:78)
at com.onresolve.jira.groovy.ScriptManagerImpl.this$dist$invoke$1(ScriptManagerImpl.groovy)
at com.onresolve.jira.groovy.ScriptManagerImpl$1.methodMissing(ScriptManagerImpl.groovy) <+3> (NativeMethodAccessorImpl.java:57) (DelegatingMethodAccessorImpl.java:43)
...
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:137)
at com.onresolve.jira.groovy.ScriptManagerImpl$1.run(ScriptManagerImpl.groovy:394)
... 1 more
Cause
From the stack trace, we can see that the problem is caused by the Script Runner plugin:
Caused by: java.lang.NullPointerException
...
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:137)
at com.onresolve.jira.groovy.ScriptManagerImpl$1.run(ScriptManagerImpl.groovy:394)
Resolution
If JIRA is running, stop JIRA.
Remove the ScriptRunner/GroovyRunner JAR file from the JIRA Home Directory.
The plugins folder in the Home Directory can be found in:
$HOME_DIRECTORY/plugins/installed-plugins
- After removing the plugin, restart JIRA.
- Proceed to retry the indexing process.
- Note: The plugin can be re-added to JIRA after the upgrade completes successfully.
Last modified on Mar 30, 2016
Powered by Confluence and Scroll Viewport.