Problem running timelion

Hi,

I've seen similar topics here, but couldnt dig an answer that solved my problem. So again, when installing kibana 5.0.0-rc1 I am getting the following error when opening the timelion view (everything else seems to work in kibana):

    Error:  in cell #1: [reduce_search_phase_exception] [reduce] 
at throwWithCell (/opt/kibana/src/core_plugins/timelion/server/handlers/chain_runner.js:30:11)
at /opt/kibana/src/core_plugins/timelion/server/handlers/chain_runner.js:156:13
at arrayEach (/opt/kibana/node_modules/lodash/index.js:1289:13)
at Function.<anonymous> (/opt/kibana/node_modules/lodash/index.js:3345:13)
at /opt/kibana/src/core_plugins/timelion/server/handlers/chain_runner.js:148:9
at tryCatcher (/opt/kibana/node_modules/bluebird/js/main/util.js:26:23)
at Promise._settlePromiseFromHandler (/opt/kibana/node_modules/bluebird/js/main/promise.js:503:31)
at Promise._settlePromiseAt (/opt/kibana/node_modules/bluebird/js/main/promise.js:577:18)
at Promise._settlePromises (/opt/kibana/node_modules/bluebird/js/main/promise.js:693:14)
at Async._drainQueue (/opt/kibana/node_modules/bluebird/js/main/async.js:123:16)
at Async._drainQueues (/opt/kibana/node_modules/bluebird/js/main/async.js:133:10)
at Immediate.Async.drainQueues (/opt/kibana/node_modules/bluebird/js/main/async.js:15:14)
at runCallback (timers.js:574:20)
at tryOnImmediate (timers.js:554:5)
at processImmediate [as _immediateCallback] (timers.js:533:5)

Strange thing, this only happens on my server, local installation is working fine. What am I missing on the server, any dependency, port to be opened, whatever?

Thanks in advance!
Andrej

Any errors in your ES logs?

Indeed:

[2016-10-24T09:39:56,023][DEBUG][o.e.a.s.TransportSearchAction] [enter.your.host.here] failed to reduce search
org.elasticsearch.action.search.ReduceSearchPhaseException: [reduce]
at org.elasticsearch.action.search.SearchQueryThenFetchAsyncAction$2.onFailure(SearchQueryThenFetchAsyncAction.java:143) [elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.onFailure(ThreadContext.java:490) [elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:39) [elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_111]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
Caused by: java.lang.IllegalStateException: scripts of type [inline], operation [aggs] and lang [expression] are disabled
at org.elasticsearch.script.ScriptService.compile(ScriptService.java:223) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.search.aggregations.pipeline.bucketscript.BucketScriptPipelineAggregator.reduce(BucketScriptPipelineAggregator.java:95) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.search.aggregations.InternalAggregation.reduce(InternalAggregation.java:144) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.search.aggregations.InternalAggregations.reduce(InternalAggregations.java:158) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.search.aggregations.bucket.filters.InternalFilters$InternalBucket.reduce(InternalFilters.java:100) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.search.aggregations.bucket.filters.InternalFilters.doReduce(InternalFilters.java:205) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.search.aggregations.InternalAggregation.reduce(InternalAggregation.java:142) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.search.aggregations.InternalAggregations.reduce(InternalAggregations.java:158) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.action.search.SearchPhaseController.merge(SearchPhaseController.java:493) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.action.search.SearchQueryThenFetchAsyncAction$2.doRun(SearchQueryThenFetchAsyncAction.java:132) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:504) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
... 3 more
[2016-10-24T09:39:56,028][WARN ][r.suppressed ] path: /metric*/_search, params: {index=metric*}
org.elasticsearch.action.search.ReduceSearchPhaseException: [reduce]
at org.elasticsearch.action.search.SearchQueryThenFetchAsyncAction$2.onFailure(SearchQueryThenFetchAsyncAction.java:143) [elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.onFailure(ThreadContext.java:490) [elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:39) [elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_111]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
Caused by: java.lang.IllegalStateException: scripts of type [inline], operation [aggs] and lang [expression] are disabled
at org.elasticsearch.script.ScriptService.compile(ScriptService.java:223) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.search.aggregations.pipeline.bucketscript.BucketScriptPipelineAggregator.reduce(BucketScriptPipelineAggregator.java:95) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.search.aggregations.InternalAggregation.reduce(InternalAggregation.java:144) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.search.aggregations.InternalAggregations.reduce(InternalAggregations.java:158) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.search.aggregations.bucket.filters.InternalFilters$InternalBucket.reduce(InternalFilters.java:100) ~[elasticsearch-5.0.0-rc1.jar:5.0.0-rc1]
at org.elasticsearch.search.aggregations.bucket.filters.InternalFilters.doReduce(InternalFilters.java:205)
...
(reduced bc body limit)

Looks like lucene expression scripts are disabled in elasticsearch. Timelion requires lucene expressions to be enabled.

You are right, I had to enable scripts to make it running.

Is there a way to add a check to kibana for those settings and give some advice to the user what to do? The provided error is a bit confusing.

Thanks for your help!

I think that's a good idea, I've created a ticket for it here: https://github.com/elastic/kibana/issues/8829

Hey Andrej, Can you Please tell how you enabled the scripts? I am using AWS Elastic Search and have set up an independent kibana server.

Sure,

scripting has to be enabled in your elasticsearch instance. So add e.g. the following two lines to your elasticsearch.yml :

script.inline: true
script.stored: true

See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting-security.html#enable-dynamic-scripting for more details.

Actually the problem is that I am using AWS Elastic Search where AWS don't allow to make any changes in the settings. Is there any way to do it their or am I missing something?