# Error on 2 shards only

**URL:** <https://discuss.elastic.co/t/error-on-2-shards-only/17347>\
**Category:** Elasticsearch\
**Created:** [May 5, 2014, 12:40pm UTC](https://discuss.elastic.co/t/error-on-2-shards-only/17347 "2014-05-05T12:40:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan\_van\_Vlimmeren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jan_van_vlimmeren/32/1603_2.png) [@Jan\_van\_Vlimmeren](https://discuss.elastic.co/u/Jan_van_Vlimmeren)\
**Post date:** [May 5, 2014, 12:40pm UTC](https://discuss.elastic.co/t/error-on-2-shards-only/17347/1 "2014-05-05T12:40:38Z")

</div>

I'm running a cluster with 4 nodes, all with identical server specs and ES  
versions (1.1.0)

I keep running into this problem when running this query:

{  
"query": {  
"bool": {  
"must": [  
{  
"term": {  
"name": "general"  
}  
},  
{  
"term": {  
"property": "10048924"  
}  
}  
]  
}  
},  
"aggs": {  
"newsletter\_count": {  
"date\_histogram": {  
"field": "dt",  
"interval": "day"  
},  
"aggs": {  
"total": {  
"sum": {  
"field": "value"  
}  
}  
}  
}  
}  
}

Whenever I run it, I get an error on 2 shards:

- \_shards: {
  - total: 8
  - successful: 6
  - failed: 2
  - failures: [
    - {
      - index: ga
      - shard: 3
      - status: 500
      - reason: RemoteTransportException[[Jane  
Foster][inet[/188.226.213.227:9300]][search/phase/query]]; nested:  
ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData  
cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData];  
}

    - {
      - index: ga
      - shard: 7
      - status: 500
      - reason: RemoteTransportException[[Jane  
Foster][inet[/188.226.213.227:9300]][search/phase/query]]; nested:  
ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData  
cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData];  
}  
]  
}

When I destroy the index and recreate it, the same error keeps occuring but  
it will be on another node. I'm using a template for the index:

{  
"template": "ga",  
"settings": {  
"index.number\_of\_shards" : 8,  
"index.number\_of\_replicas" : 0,  
"index.routing.allocation.total\_shards\_per\_node" : 2,  
"index.auto\_expand\_replicas": false  
}  
,  
"mappings": {  
"_default_": {  
"\_source": { "compress": true }  
},  
"articles": {  
"properties": {  
"property": {"type":"integer", "index": "not\_analyzed"},  
"dt": {"type": "date", "index": "not\_analyzed"},  
"value": {"type": "integer", "index": "not\_analyzed"},  
"name": {"type": "string", "index":"not\_analyzed"}  
}}  
}  
}

Any ideas on what I'm doing wrong or how I can resolve this issue?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/13528eaa-9f0d-4514-a6e3-e4babc952a7c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/13528eaa-9f0d-4514-a6e3-e4babc952a7c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [May 5, 2014, 1:28pm UTC](https://discuss.elastic.co/t/error-on-2-shards-only/17347/2 "2014-05-05T13:28:02Z")

</div>

Check your effective mappings. Although you declared type "date" on dt, it  
might contain actually some strings or non-parseable date strings?

Jörg

On Mon, May 5, 2014 at 2:40 PM, Jan van Vlimmeren \<  
[jan.vanvlimmeren@gmail.com](mailto:jan.vanvlimmeren@gmail.com)\> wrote:

> I'm running a cluster with 4 nodes, all with identical server specs and ES  
> versions (1.1.0)
> 
> I keep running into this problem when running this query:
> 
> {  
> "query": {  
> "bool": {  
> "must": [  
> {  
> "term": {  
> "name": "general"  
> }  
> },  
> {  
> "term": {  
> "property": "10048924"  
> }  
> }  
> ]  
> }  
> },  
> "aggs": {  
> "newsletter\_count": {  
> "date\_histogram": {  
> "field": "dt",  
> "interval": "day"  
> },  
> "aggs": {  
> "total": {  
> "sum": {  
> "field": "value"  
> }  
> }  
> }  
> }  
> }  
> }
> 
> Whenever I run it, I get an error on 2 shards:
> 
> - \_shards: {
> - total: 8
> - successful: 6
> - failed: 2
> - failures: [
> - {
> - index: ga
> - shard: 3
> - status: 500
> - reason: RemoteTransportException[[Jane  
> Foster][inet[/188.226.213.227:9300]][search/phase/query]];  
> nested:  
> ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData  
> cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData];  
> }
> 
> - {
> - index: ga
> - shard: 7
> - status: 500
> - reason: RemoteTransportException[[Jane  
> Foster][inet[/188.226.213.227:9300]][search/phase/query]];  
> nested:  
> ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData  
> cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData];  
> }  
> ]  
> }
> 
> When I destroy the index and recreate it, the same error keeps occuring  
> but it will be on another node. I'm using a template for the index:
> 
> {  
> "template": "ga",  
> "settings": {  
> "index.number\_of\_shards" : 8,  
> "index.number\_of\_replicas" : 0,  
> "index.routing.allocation.total\_shards\_per\_node" : 2,  
> "index.auto\_expand\_replicas": false  
> }  
> ,  
> "mappings": {  
> "_default_": {  
> "\_source": { "compress": true }  
> },  
> "articles": {  
> "properties": {  
> "property": {"type":"integer", "index": "not\_analyzed"},  
> "dt": {"type": "date", "index": "not\_analyzed"},  
> "value": {"type": "integer", "index": "not\_analyzed"},  
> "name": {"type": "string", "index":"not\_analyzed"}  
> }}  
> }  
> }
> 
> Any ideas on what I'm doing wrong or how I can resolve this issue?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/13528eaa-9f0d-4514-a6e3-e4babc952a7c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/13528eaa-9f0d-4514-a6e3-e4babc952a7c%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/13528eaa-9f0d-4514-a6e3-e4babc952a7c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/13528eaa-9f0d-4514-a6e3-e4babc952a7c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEe2-7fiUXTX11ZH\_E-3rzWN7k%2BPvbyTBh\_Nc%2BwZo1tVA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEe2-7fiUXTX11ZH_E-3rzWN7k%2BPvbyTBh_Nc%2BwZo1tVA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jan\_van\_Vlimmeren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jan_van_vlimmeren/32/1603_2.png) [@Jan\_van\_Vlimmeren](https://discuss.elastic.co/u/Jan_van_Vlimmeren)\
**Post date:** [May 5, 2014, 2:06pm UTC](https://discuss.elastic.co/t/error-on-2-shards-only/17347/3 "2014-05-05T14:06:05Z")

</div>

That was it, many thanks.

Strange only 2 shards fail and the output seemed correct except for the  
data on those shards.

On Monday, May 5, 2014 3:28:02 PM UTC+2, Jörg Prante wrote:

> Check your effective mappings. Although you declared type "date" on dt, it  
> might contain actually some strings or non-parseable date strings?
> 
> Jörg
> 
> On Mon, May 5, 2014 at 2:40 PM, Jan van Vlimmeren \<[jan.vanv...@gmail.com](mailto:jan.vanv...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > I'm running a cluster with 4 nodes, all with identical server specs and  
> > ES versions (1.1.0)
> > 
> > I keep running into this problem when running this query:
> > 
> > {  
> > "query": {  
> > "bool": {  
> > "must": [  
> > {  
> > "term": {  
> > "name": "general"  
> > }  
> > },  
> > {  
> > "term": {  
> > "property": "10048924"  
> > }  
> > }  
> > ]  
> > }  
> > },  
> > "aggs": {  
> > "newsletter\_count": {  
> > "date\_histogram": {  
> > "field": "dt",  
> > "interval": "day"  
> > },  
> > "aggs": {  
> > "total": {  
> > "sum": {  
> > "field": "value"  
> > }  
> > }  
> > }  
> > }  
> > }  
> > }
> > 
> > Whenever I run it, I get an error on 2 shards:
> > 
> > - \_shards: {
> > - total: 8
> > - successful: 6
> > - failed: 2
> > - failures: [
> > - {
> > - index: ga
> > - shard: 3
> > - status: 500
> > - reason: RemoteTransportException[[Jane  
> > Foster][inet[/188.226.213.227:9300]][search/phase/query]]; nested:  
> > ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData  
> > cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData];  
> > }
> > 
> > - {
> > - index: ga
> > - shard: 7
> > - status: 500
> > - reason: RemoteTransportException[[Jane  
> > Foster][inet[/188.226.213.227:9300]][search/phase/query]]; nested:  
> > ClassCastException[org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData  
> > cannot be cast to org.elasticsearch.index.fielddata.IndexNumericFieldData];  
> > }  
> > ]  
> > }
> > 
> > When I destroy the index and recreate it, the same error keeps occuring  
> > but it will be on another node. I'm using a template for the index:
> > 
> > {  
> > "template": "ga",  
> > "settings": {  
> > "index.number\_of\_shards" : 8,  
> > "index.number\_of\_replicas" : 0,  
> > "index.routing.allocation.total\_shards\_per\_node" : 2,  
> > "index.auto\_expand\_replicas": false  
> > }  
> > ,  
> > "mappings": {  
> > "_default_": {  
> > "\_source": { "compress": true }  
> > },  
> > "articles": {  
> > "properties": {  
> > "property": {"type":"integer", "index": "not\_analyzed"},  
> > "dt": {"type": "date", "index": "not\_analyzed"},  
> > "value": {"type": "integer", "index": "not\_analyzed"},  
> > "name": {"type": "string", "index":"not\_analyzed"}  
> > }}  
> > }  
> > }
> > 
> > Any ideas on what I'm doing wrong or how I can resolve this issue?
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/13528eaa-9f0d-4514-a6e3-e4babc952a7c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/13528eaa-9f0d-4514-a6e3-e4babc952a7c%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/13528eaa-9f0d-4514-a6e3-e4babc952a7c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/13528eaa-9f0d-4514-a6e3-e4babc952a7c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a1bdeef7-26b2-453e-b649-787ad3609b12%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a1bdeef7-26b2-453e-b649-787ad3609b12%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:31am UTC](https://discuss.elastic.co/t/error-on-2-shards-only/17347/4 "2017-07-06T01:31:39Z")

</div>


