Elastic Runetime Error ScriptException

I am getting this error in the Elasticsearch logs, does anyone what this is from:

[2017-12-21T10:57:21,040][ERROR][o.e.x.w.t.s.ExecutableScriptTransform] [4mjFsbb] failed to execute [script] transform for [v4VKEfxATo-5dDLbaIaBHA_elasticsearch_cluster_status_c881aff0-545b-4715-8c9d-da651d965bc5-2017-12-21T18:57:20.987Z]
org.elasticsearch.script.ScriptException: runtime error
at org.elasticsearch.painless.PainlessScript.convertToScriptException(PainlessScript.java:101) ~[?:?]
at org.elasticsearch.painless.PainlessScript$Script.execute(ctx.vars.email_recipient = (ctx.payload.kibana_settings.hits.total > 0) ? ctx.payload.kibana_settings.hits.hits[0]._source.kibana_settings.xpack.default_admin_email : null;ctx.vars.is_new = ctx.vars.fails_check && !ctx.vars.not_resolved;ctx.vars.is_resolve ...:1070) ~[?:?]
at org.elasticsearch.painless.ScriptImpl.run(ScriptImpl.java:105) ~[?:?]
at org.elasticsearch.xpack.watcher.transform.script.ExecutableScriptTransform.doExecute(ExecutableScriptTransform.java:69) ~[x-pack-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.xpack.watcher.transform.script.ExecutableScriptTransform.execute(ExecutableScriptTransform.java:53) ~[x-pack-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.xpack.watcher.transform.script.ExecutableScriptTransform.execute(ExecutableScriptTransform.java:38) ~[x-pack-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.xpack.watcher.execution.ExecutionService.executeInner(ExecutionService.java:471) ~[x-pack-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.xpack.watcher.execution.ExecutionService.execute(ExecutionService.java:313) ~[x-pack-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.xpack.watcher.execution.ExecutionService.lambda$executeAsync$7(ExecutionService.java:416) ~[x-pack-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.xpack.watcher.execution.ExecutionService$WatchExecutionTask.run(ExecutionService.java:568) [x-pack-6.0.0-rc1.jar:6.0.0-rc1]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:569) [elasticsearch-6.0.0-rc1.jar:6.0.0-rc1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_60]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_60]
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[?:1.8.0_60]
at java.util.ArrayList.get(ArrayList.java:429) ~[?:1.8.0_60]
at org.elasticsearch.painless.PainlessScript$Script.execute(ctx.vars.email_recipient = (ctx.payload.kibana_settings.hits.total > 0) ? ctx.payload.kibana_settings.hits.hits[0]._source.kibana_settings.xpack.default_admin_email : null;ctx.vars.is_new = ctx.vars.fails_check && !ctx.vars.not_resolved;ctx.vars.is_resolve ...:347) ~[?:?]

hits.total is not representative of how many results are actually returned in hits. For example, you could set size=0 (thus hits.hits will be zero length), but total would not change regardless of the size parameter. What is the query you are running to generate ctx.payload.kibana_settings?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.