Indexing exception related to Groovy Scriptrunner

I am getting many exceptions like below while indexing. I assume it's related to a groovy scriptrunner scripted field, but the log doesn't hint which one or the issue causing the exception.

Any ideas to troubleshoot the problem?

 

2015-10-17 12:37:18,762 JiraTaskExectionThread-1 ERROR anonymous     [onresolve.jira.groovy.GroovyCustomField] javax.script.ScriptException: java.lang.NullPointerException
javax.script.ScriptException: javax.script.ScriptException: java.lang.NullPointerException
    at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:117)
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
    at javax.script.ScriptEngine$eval.call(Unknown Source)
    at com.onresolve.jira.groovy.GroovyCustomField.getValueFromIssue(GroovyCustomField.groovy:160)
    at com.atlassian.jira.issue.fields.CustomFieldImpl.getValue(CustomFieldImpl.java:454)
    at com.atlassian.jira.issue.index.indexers.impl.ExactTextCustomFieldIndexer.addDocumentFields(ExactTextCustomFieldIndexer.java:39)
    at com.atlassian.jira.issue.index.indexers.impl.ExactTextCustomFieldIndexer.addDocumentFieldsSearchable(ExactTextCustomFieldIndexer.java:29)
    at com.atlassian.jira.issue.index.indexers.impl.AbstractCustomFieldIndexer.addIndex(AbstractCustomFieldIndexer.java:46)
    at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory$Builder.add(DefaultIssueDocumentFactory.java:102)
    at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory$Builder.addAll(DefaultIssueDocumentFactory.java:91)
    at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory.apply(DefaultIssueDocumentFactory.java:60)
    at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory.apply(DefaultIssueDocumentFactory.java:37)
    at com.atlassian.jira.issue.index.DefaultIssueIndexer$DefaultDocumentCreationStrategy.get(DefaultIssueIndexer.java:644)
    at com.atlassian.jira.issue.index.DefaultIssueIndexer$2.perform(DefaultIssueIndexer.java:182)
    at com.atlassian.jira.issue.index.DefaultIssueIndexer$2.perform(DefaultIssueIndexer.java:175)
    at com.atlassian.jira.issue.index.DefaultIssueIndexer$3$1.get(DefaultIssueIndexer.java:334)
    at com.atlassian.jira.issue.index.DefaultIssueIndexer$3$1.get(DefaultIssueIndexer.java:330)
    at com.atlassian.jira.index.SimpleIndexingStrategy.get(SimpleIndexingStrategy.java:9)
    at com.atlassian.jira.index.SimpleIndexingStrategy.get(SimpleIndexingStrategy.java:5)
    at com.atlassian.jira.issue.index.DefaultIssueIndexer$3.consume(DefaultIssueIndexer.java:329)
    at com.atlassian.jira.issue.index.DefaultIssueIndexer$3.consume(DefaultIssueIndexer.java:321)
    at com.atlassian.jira.issue.util.DatabaseIssuesIterable.foreach(DatabaseIssuesIterable.java:66)
    at com.atlassian.jira.issue.index.DefaultIssueIndexer.perform(DefaultIssueIndexer.java:320)
    at com.atlassian.jira.issue.index.DefaultIssueIndexer.reindexIssues(DefaultIssueIndexer.java:174)
    at com.atlassian.jira.issue.index.DefaultIndexManager.doBackgroundReindex(DefaultIndexManager.java:1083)
    at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexAll(DefaultIndexManager.java:322)
    at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssuesInBackground(DefaultIndexManager.java:414)  <+3> (NativeMethodAccessorImpl.java:62) (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    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.$Proxy15.reIndexIssuesInBackground(Unknown Source)
    at com.atlassian.jira.util.index.CompositeIndexLifecycleManager.reIndexIssuesInBackground(CompositeIndexLifecycleManager.java:123)
    at com.atlassian.jira.web.action.admin.index.ReIndexBackgroundIndexerCommand.doReindex(ReIndexBackgroundIndexerCommand.java:37)
    at com.atlassian.jira.web.action.admin.index.AbstractAsyncIndexerCommand.call(AbstractAsyncIndexerCommand.java:59)
    at com.atlassian.jira.web.action.admin.index.ReIndexBackgroundIndexerCommand.call(ReIndexBackgroundIndexerCommand.java:16)
    at com.atlassian.jira.web.action.admin.index.AbstractAsyncIndexerCommand.call(AbstractAsyncIndexerCommand.java:24)
    at com.atlassian.jira.index.request.DefaultReindexRequestManager$RunReindexAndUpdateRequestTask.call(DefaultReindexRequestManager.java:666)
    at com.atlassian.jira.index.request.DefaultReindexRequestManager$RunReindexAndUpdateRequestTask.call(DefaultReindexRequestManager.java:647)
    at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:528)
    at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:491)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:254)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javax.script.ScriptException: java.lang.NullPointerException
    at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:318)
    at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:111)
    ... 47 more
Caused by: java.lang.NullPointerException
    at org.codehaus.groovy.runtime.dgmimpl.NumberNumberMinus$LongLong.call(NumberNumberMinus.java:281)
    at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:315)
    ... 48 more

2 answers

1 accepted

1 vote

Plugin version? Recent versions of the plugin should tell you exactly which field is causing the problem.

It's 3.1.4 on JIRA 6.4.12

@Jamie Echlin [Adaptavist] Sorry, that error came with 2.1.16. I will reindex again with 3.1.4 and see what happens.

@Jamie Echlin [Adaptavist] In 3.1.4 I can tell the issue and the scripted field. With this I fixed the exception. Thanks.

great, thanks for letting me know.

How many Scripted Fields do you have? Can you try editing them in the "Scripted Fields" section and test each one? You may also put a logging on each scripted field too.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,308 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot