Upgrading JIRA fails with nullPointerException
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Symptoms
Upgrading JIRA completes successfully without errors, but certain actions in JIRA fails to complete with a 500 page error, or JIRA fails to start up.
The following appears in the atlassian-jira.log
: (ℹ️ The stack trace has been shortened for brevity. Some of the lines are replaced with ... You should only take note of the Groovy classes)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
An error occurred performing JIRA upgrade
The data before the upgrade has been exported to /xxx/jira_autoexport_xxx_xxx.zip 2014-04-08 18:38:25 error
Exception thrown during upgrade: java.lang.NullPointerException
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:87)
at com.atlassian.jira.issue.fields.CustomFieldImpl.getCustomFieldSearcher(CustomFieldImpl.java:1911)
at com.atlassian.jira.issue.fields.CustomFieldImpl.(CustomFieldImpl.java:251)
at com.atlassian.jira.issue.fields.CustomFieldImpl.(CustomFieldImpl.java:224)
at com.atlassian.jira.issue.managers.DefaultCustomFieldManager.getCustomFieldsFromIds(DefaultCustomFieldManager.java:460)
...
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 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 com.onresolve.jira.groovy.ScriptManagerImpl.createIndexingCustomField(ScriptManagerImpl.groovy:466)
...
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)
Cause
The problem is caused by the ScriptRunner (also called GroovyRunner) plugin. We can observe that the stack trace contains the following classes:
1
2
3
4
5
6
7
8
9
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 com.onresolve.jira.groovy.ScriptManagerImpl.createIndexingCustomField(ScriptManagerImpl.groovy:466)
...
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)
Resolution
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, retry the upgrade process or restart JIRA.
Note: The plugin can be re-added to JIRA after the upgrade completes successfully.
Was this helpful?