# Shard error on elasticsearch upgrade

**URL:** <https://discuss.elastic.co/t/shard-error-on-elasticsearch-upgrade/12776>\
**Category:** Elasticsearch\
**Created:** [July 12, 2013, 6:05pm UTC](https://discuss.elastic.co/t/shard-error-on-elasticsearch-upgrade/12776 "2013-07-12T18:05:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 12, 2013, 6:05pm UTC](https://discuss.elastic.co/t/shard-error-on-elasticsearch-upgrade/12776/1 "2013-07-12T18:05:41Z")

</div>

Finally upgrade our production cluster from 0.20.0RC2 to 0.90.2. Using the  
old index built with 0.20, we started getting NumberFormatExceptions.

Example query:

"\_shards": {  
"total": 8,  
"successful": 7,  
"failed": 1,  
"failures": [  
{  
"index": "foo",  
"shard": 7,  
"status": 500,  
"reason":  
"RemoteTransportException[[...][inet[/....159:9300]][search/phase/query]];  
nested: QueryPhaseExecutionException[[foo][7]: query[...],from[0],size[40]:  
Query Failed [Failed to execute main query]]; nested:  
ElasticSearchException[java.lang.NumberFormatException: Invalid shift value  
(64) in prefixCoded bytes (is encoded value really an INT?)]; nested:  
UncheckedExecutionException[java.lang.NumberFormatException: Invalid shift  
value (64) in prefixCoded bytes (is encoded value really an INT?)]; nested:  
NumberFormatException[Invalid shift value (64) in prefixCoded bytes (is  
encoded value really an INT?)]; "  
}  
]  
}

In this example, 1 shard out of 8 is failing because of an invalid shard.  
We saw this issue when we upgraded our development cluster, but ignored it  
because it was only the development cluster. A full reindex with the latest  
version made the issue go away, and we are hoping the same holds true this  
time around as well.

Cheers,

Ivan

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 12, 2013, 6:23pm UTC](https://discuss.elastic.co/t/shard-error-on-elasticsearch-upgrade/12776/2 "2013-07-12T18:23:09Z")

</div>

I pruned the query until I was able to get a minimal query that would  
break. The issue occurs while faceting on one specific field.

Failure:  
{  
"query" : {  
"match\_all" : { }  
},  
"facets" : {  
"CatalogID" : {  
"terms" : {  
"field" : "CatalogID",  
"size" : 20  
}  
}  
}  
}

Where the mapping is CatalogID: { type: long }

Querying on that field with no facets works fine. This facet is one of  
many, most of which are long fields.

Cheers,

Ivan

On Fri, Jul 12, 2013 at 11:05 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> Finally upgrade our production cluster from 0.20.0RC2 to 0.90.2. Using  
> the old index built with 0.20, we started getting NumberFormatExceptions.
> 
> Example query:
> 
> "\_shards": {  
> "total": 8,  
> "successful": 7,  
> "failed": 1,  
> "failures": [  
> {  
> "index": "foo",  
> "shard": 7,  
> "status": 500,  
> "reason":  
> "RemoteTransportException[[...][inet[/....159:9300]][search/phase/query]];  
> nested: QueryPhaseExecutionException[[foo][7]: query[...],from[0],size[40]:  
> Query Failed [Failed to execute main query]]; nested:  
> ElasticSearchException[java.lang.NumberFormatException: Invalid shift value  
> (64) in prefixCoded bytes (is encoded value really an INT?)]; nested:  
> UncheckedExecutionException[java.lang.NumberFormatException: Invalid shift  
> value (64) in prefixCoded bytes (is encoded value really an INT?)]; nested:  
> NumberFormatException[Invalid shift value (64) in prefixCoded bytes (is  
> encoded value really an INT?)]; "  
> }  
> ]  
> }
> 
> In this example, 1 shard out of 8 is failing because of an invalid shard.  
> We saw this issue when we upgraded our development cluster, but ignored it  
> because it was only the development cluster. A full reindex with the latest  
> version made the issue go away, and we are hoping the same holds true this  
> time around as well.
> 
> Cheers,
> 
> Ivan

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![vinh](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@vinh](https://discuss.elastic.co/u/vinh)\
**Post date:** [July 12, 2013, 7:03pm UTC](https://discuss.elastic.co/t/shard-error-on-elasticsearch-upgrade/12776/3 "2013-07-12T19:03:45Z")

</div>

Ivan, thanks for sharing this find!  
-Vinh

On Jul 12, 2013, at 11:23 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> I pruned the query until I was able to get a minimal query that would break. The issue occurs while faceting on one specific field.
> 
> Failure:  
> {  
> "query" : {  
> "match\_all" : { }  
> },  
> "facets" : {  
> "CatalogID" : {  
> "terms" : {  
> "field" : "CatalogID",  
> "size" : 20  
> }  
> }  
> }  
> }
> 
> Where the mapping is CatalogID: { type: long }
> 
> Querying on that field with no facets works fine. This facet is one of many, most of which are long fields.
> 
> Cheers,
> 
> Ivan
> 
> On Fri, Jul 12, 2013 at 11:05 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:  
> Finally upgrade our production cluster from 0.20.0RC2 to 0.90.2. Using the old index built with 0.20, we started getting NumberFormatExceptions.
> 
> Example query:
> 
> "\_shards": {  
> "total": 8,  
> "successful": 7,  
> "failed": 1,  
> "failures": [  
> {  
> "index": "foo",  
> "shard": 7,  
> "status": 500,  
> "reason": "RemoteTransportException[[...][inet[/....159:9300]][search/phase/query]]; nested: QueryPhaseExecutionException[[foo][7]: query[...],from[0],size[40]: Query Failed [Failed to execute main query]]; nested: ElasticSearchException[java.lang.NumberFormatException: Invalid shift value (64) in prefixCoded bytes (is encoded value really an INT?)]; nested: UncheckedExecutionException[java.lang.NumberFormatException: Invalid shift value (64) in prefixCoded bytes (is encoded value really an INT?)]; nested: NumberFormatException[Invalid shift value (64) in prefixCoded bytes (is encoded value really an INT?)]; "  
> }  
> ]  
> }
> 
> In this example, 1 shard out of 8 is failing because of an invalid shard. We saw this issue when we upgraded our development cluster, but ignored it because it was only the development cluster. A full reindex with the latest version made the issue go away, and we are hoping the same holds true this time around as well.
> 
> Cheers,
> 
> Ivan
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:26am UTC](https://discuss.elastic.co/t/shard-error-on-elasticsearch-upgrade/12776/4 "2017-07-06T02:26:42Z")

</div>


