# \[DataTable\]3 of 15 shards failed

**URL:** https://discuss.elastic.co/t/datatable-3-of-15-shards-failed/164068
**Category:** Kibana
**Created:** [January 14, 2019, 2:08am UTC](https://discuss.elastic.co/t/datatable-3-of-15-shards-failed/164068 "2019-01-14T02:08:38Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![hyhong](https://avatars.discourse-cdn.com/v4/letter/h/3bc359/32.png) [@hyhong](https://discuss.elastic.co/u/hyhong)
#### Post date: [January 14, 2019, 2:08am UTC](https://discuss.elastic.co/t/datatable-3-of-15-shards-failed/164068/1 "2019-01-14T02:08:38Z")

</div>

kibana version: 6.5.1  
When I use JSON input of DataTable,it throws an error: 3 of 15 shards failed,detail as follows:  
JSON input:  
{  
"script": {  
"source": "if(doc['currency.keyword'].value=='AAA'&&doc['country.keyword'].value=='BBB'){return doc.cost.value}"  
}  
}  
ERROR:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/6/66ba5b5ae7cfcbf79d6f3edb0f56e90a6d452254.png)

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [January 14, 2019, 2:11am UTC](https://discuss.elastic.co/t/datatable-3-of-15-shards-failed/164068/2 "2019-01-14T02:11:54Z")

</div>

Check your Elasticsearch logs, there should be more on why it failed there.

---

<div class="post-metadata">

### Author: ![hyhong](https://avatars.discourse-cdn.com/v4/letter/h/3bc359/32.png) [@hyhong](https://discuss.elastic.co/u/hyhong)
#### Post date: [January 14, 2019, 3:14am UTC](https://discuss.elastic.co/t/datatable-3-of-15-shards-failed/164068/3 "2019-01-14T03:14:11Z")

</div>

elasticsearch'log is:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/f/8f80b5addf01a202b101925365f96b8350687711.png)  
and is there any solutions?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [January 14, 2019, 3:14am UTC](https://discuss.elastic.co/t/datatable-3-of-15-shards-failed/164068/4 "2019-01-14T03:14:20Z")

</div>

Please don't post pictures of text, they are difficult to read and some people may not be even able to see them.

---

<div class="post-metadata">

### Author: ![hyhong](https://avatars.discourse-cdn.com/v4/letter/h/3bc359/32.png) [@hyhong](https://discuss.elastic.co/u/hyhong)
#### Post date: [January 14, 2019, 3:17am UTC](https://discuss.elastic.co/t/datatable-3-of-15-shards-failed/164068/5 "2019-01-14T03:17:26Z")

</div>

Thanks! Logs as follows:  
Caused by: org.elasticsearch.search.query.QueryPhaseExecutionException: Query Failed [Failed to execute main query]  
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:301) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:107) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:330) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:377) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.SearchService.access$100(SearchService.java:121) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:339) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:335) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.SearchService$4.doRun(SearchService.java:1082) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:723) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:41) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-6.5.1.jar:6.5.1]  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0\_152]  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0\_152]  
at java.lang.Thread.run(Thread.java:748) [?:1.8.0\_152]  
Caused by: java.lang.NullPointerException  
at org.elasticsearch.painless.ScriptImpl.runAsDouble(ScriptImpl.java:109) ~[?:?]  
at org.elasticsearch.search.aggregations.support.ValuesSource$Numeric$WithScript$DoubleValues.advanceExact(ValuesSource.java:340) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.aggregations.metrics.avg.AvgAggregator$1.collect(AvgAggregator.java:83) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.aggregations.MultiBucketCollector$MultiLeafBucketCollector.collect(MultiBucketCollector.java:195) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.aggregations.bucket.BucketsAggregator.collectExistingBucket(BucketsAggregator.java:84) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.aggregations.bucket.BucketsAggregator.collectBucket(BucketsAggregator.java:76) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.collectGlobalOrd(GlobalOrdinalsStringTermsAggregator.java:119) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.access$100(GlobalOrdinalsStringTermsAggregator.java:59) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator$2.collect(GlobalOrdinalsStringTermsAggregator.java:154) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.aggregations.LeafBucketCollector.collect(LeafBucketCollector.java:82) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.apache.lucene.search.MultiCollector$MultiLeafCollector.collect(MultiCollector.java:174) ~[lucene-core-7.5.0.jar:7.5.0 b5bf70b7e32d7ddd9742cc821d471c5fabd4e3df - jimczi - 2018-09-18 13:01:13]  
at org.apache.lucene.search.Weight$DefaultBulkScorer.scoreAll(Weight.java:263) ~[lucene-core-7.5.0.jar:7.5.0 b5bf70b7e32d7ddd9742cc821d471c5fabd4e3df - jimczi - 2018-09-18 13:01:13]  
at org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:214) ~[lucene-core-7.5.0.jar:7.5.0 b5bf70b7e32d7ddd9742cc821d471c5fabd4e3df - jimczi - 2018-09-18 13:01:13]  
at org.apache.lucene.search.BulkScorer.score(BulkScorer.java:39) ~[lucene-core-7.5.0.jar:7.5.0 b5bf70b7e32d7ddd9742cc821d471c5fabd4e3df - jimczi - 2018-09-18 13:01:13]  
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:670) ~[lucene-core-7.5.0.jar:7.5.0 b5bf70b7e32d7ddd9742cc821d471c5fabd4e3df - jimczi - 2018-09-18 13:01:13]  
at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:191) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:471) ~[lucene-core-7.5.0.jar:7.5.0 b5bf70b7e32d7ddd9742cc821d471c5fabd4e3df - jimczi - 2018-09-18 13:01:13]  
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:269) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:107) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:330) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:377) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.SearchService.access$100(SearchService.java:121) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:339) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:335) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.search.SearchService$4.doRun(SearchService.java:1082) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:723) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:41) ~[elasticsearch-6.5.1.jar:6.5.1]  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-6.5.1.jar:6.5.1]  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0\_152]  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0\_152]  
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0\_152]

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 11, 2019, 3:17am UTC](https://discuss.elastic.co/t/datatable-3-of-15-shards-failed/164068/6 "2019-02-11T03:17:28Z")

</div>

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