Given:
I have an empty report stored (with view being null)
When:
The Update to 3.4.0 is run
Then:
it fails with an error during report reindex, in the elastic log this error is visible:
{"type": "server", "timestamp": "2021-04-07T13:23:21,013Z", "level": "WARN", "component": "o.e.t.LoggingTaskListener", "cluster.name": "elasticsearch", "node.name": "4c40ad8878e1", "message": "1870 failed with exception", "cluster.uuid": "2K7WakHqSyiW9DPXnH7DWA", "node.id": "7bR4CZA8RjC2NfYebQFJ8Q" , "stacktrace": ["org.elasticsearch.script.ScriptException: runtime error", "at org.elasticsearch.painless.PainlessScript.convertToScriptException(PainlessScript.java:85) ~[?:?]", "at org.elasticsearch.painless.PainlessScript$Script.execute(def reportEntityType = ctx._source.data.view.entity; ...:1) ~[?:?]", "at org.elasticsearch.index.reindex.AbstractAsyncBulkByScrollAction$ScriptApplier.apply(AbstractAsyncBulkByScrollAction.java:764) ~[?:?]", "at org.elasticsearch.index.reindex.AbstractAsyncBulkByScrollAction$ScriptApplier.apply(AbstractAsyncBulkByScrollAction.java:725) ~[?:?]", "at org.elasticsearch.index.reindex.AbstractAsyncBulkByScrollAction.buildBulk(AbstractAsyncBulkByScrollAction.java:196) ~[?:?]", "at org.elasticsearch.index.reindex.AbstractAsyncBulkByScrollAction.prepareBulkRequest(AbstractAsyncBulkByScrollAction.java:315) ~[?:?]", "at org.elasticsearch.index.reindex.AbstractAsyncBulkByScrollAction$1.doRun(AbstractAsyncBulkByScrollAction.java:277) ~[?:?]", "at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:732) [elasticsearch-7.11.0.jar:7.11.0]", "at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) [elasticsearch-7.11.0.jar:7.11.0]", "at org.elasticsearch.common.util.concurrent.RunOnce.run(RunOnce.java:29) ~[elasticsearch-7.11.0.jar:7.11.0]", "at org.elasticsearch.index.reindex.WorkerBulkByScrollTaskState$DelayedPrepareBulkRequest.lambda$new$0(WorkerBulkByScrollTaskState.java:248) ~[elasticsearch-7.11.0.jar:7.11.0]",{"type": "server", "timestamp": "2021-04-07T13:23:21,013Z", "level": "WARN", "component": "o.e.t.LoggingTaskListener", "cluster.name": "elasticsearch", "node.name": "4c40ad8878e1", "message": "1870 failed with exception", "cluster.uuid": "2K7WakHqSyiW9DPXnH7DWA", "node.id": "7bR4CZA8RjC2NfYebQFJ8Q" , "stacktrace": ["org.elasticsearch.script.ScriptException: runtime error", "at org.elasticsearch.painless.PainlessScript.convertToScriptException(PainlessScript.java:85) ~[?:?]", "at org.elasticsearch.painless.PainlessScript$Script.execute(def reportEntityType = ctx._source.data.view.entity; ...:1) ~[?:?]", "at org.elasticsearch.index.reindex.AbstractAsyncBulkByScrollAction$ScriptApplier.apply(AbstractAsyncBulkByScrollAction.java:764) ~[?:?]", "at org.elasticsearch.index.reindex.AbstractAsyncBulkByScrollAction$ScriptApplier.apply(AbstractAsyncBulkByScrollAction.java:725) ~[?:?]", "at org.elasticsearch.index.reindex.AbstractAsyncBulkByScrollAction.buildBulk(AbstractAsyncBulkByScrollAction.java:196) ~[?:?]", "at org.elasticsearch.index.reindex.AbstractAsyncBulkByScrollAction.prepareBulkRequest(AbstractAsyncBulkByScrollAction.java:315) ~[?:?]", "at org.elasticsearch.index.reindex.AbstractAsyncBulkByScrollAction$1.doRun(AbstractAsyncBulkByScrollAction.java:277) ~[?:?]", "at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:732) [elasticsearch-7.11.0.jar:7.11.0]", "at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) [elasticsearch-7.11.0.jar:7.11.0]", "at org.elasticsearch.common.util.concurrent.RunOnce.run(RunOnce.java:29) ~[elasticsearch-7.11.0.jar:7.11.0]", "at org.elasticsearch.index.reindex.WorkerBulkByScrollTaskState$DelayedPrepareBulkRequest.lambda$new$0(WorkerBulkByScrollTaskState.java:248) ~[elasticsearch-7.11.0.jar:7.11.0]", "at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673) ~[elasticsearch-7.11.0.jar:7.11.0]",in Optimize "at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]", "at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]", "at java.lang.Thread.run(Thread.java:832) [?:?]", "Caused by: java.lang.NullPointerException: Cannot invoke \"Object.getClass()\" because \"receiver\" is null", "at org.elasticsearch.painless.DefBootstrap$PIC.checkClass(DefBootstrap.java:134) ~[?:?]", "at org.elasticsearch.painless.PainlessScript$Script.execute(def reportEntityType = ctx._source.data.view.entity; ...:45) ~[?:?]", "... 13 more"] } "at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673) ~[elasticsearch-7.11.0.jar:7.11.0]", "at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]", "at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]", "at java.lang.Thread.run(Thread.java:832) [?:?]", "Caused by: java.lang.NullPointerException: Cannot invoke \"Object.getClass()\" because \"receiver\" is null", "at org.elasticsearch.painless.DefBootstrap$PIC.checkClass(DefBootstrap.java:134) ~[?:?]", "at org.elasticsearch.painless.PainlessScript$Script.execute(def reportEntityType = ctx._source.data.view.entity; ...:45) ~[?:?]", "... 13 more"] }
Expected:
The update should be able to cope with empty reports