# How read or analyze content of state.st file?

**URL:** <https://discuss.elastic.co/t/how-read-or-analyze-content-of-state-st-file/100249>\
**Category:** Elasticsearch\
**Created:** [September 12, 2017, 7:03pm UTC](https://discuss.elastic.co/t/how-read-or-analyze-content-of-state-st-file/100249 "2017-09-12T19:03:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vsevolodk](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@vsevolodk](https://discuss.elastic.co/u/vsevolodk)\
**Post date:** [September 12, 2017, 7:03pm UTC](https://discuss.elastic.co/t/how-read-or-analyze-content-of-state-st-file/100249/1 "2017-09-12T19:03:45Z")

</div>

Hi, please help.  
I got excetion on elasticsearch 2.3.5 (lucen 5.5.0)

```auto
Caused by: java.io.IOException: failed to read [id:1, legacy:false, file:/esdata/elasticsearch/nodes/0/indices/ta4TwW_jS1WJl7PhghEW-Q/_state/state-1.st]
	at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestState(MetaDataStateFormat.java:304)
	... 50 more
Caused by: org.elasticsearch.gateway.CorruptStateException: Format version is not supported (resource SimpleFSIndexInput(path="/esdata/elasticsearch/nodes/0/indices/ta4TwW_jS1WJl7PhghEW-Q/_state/state-1.st")): 1 (needs to be between 0 and 0)
	at org.apache.lucene.codecs.CodecUtil.checkHeaderNoMagic(CodecUtil.java:216)

```

Tool lluke 5.5.0 can read index folders in folder `ta4TwW_jS1WJl7PhghEW-Q` and says that documents are generated by lucene 5.3 or later.

So I dont' know what is wrong.  
How can I inspect content of [state.st](http://state.st) files?

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [September 15, 2017, 4:39pm UTC](https://discuss.elastic.co/t/how-read-or-analyze-content-of-state-st-file/100249/2 "2017-09-15T16:39:04Z")

</div>

State files are SMILE-encoded files with additional checksum and version headers, there isn't a way to really read them, however, you can use a hex editor to inspect the contents of the state file (to see what it contains)

Do you perhaps have a backup copy of the data that you can restore a non-corrupt version of the state from?

---

<div class="post-metadata">

**Author:** ![vsevolodk](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@vsevolodk](https://discuss.elastic.co/u/vsevolodk)\
**Post date:** [September 16, 2017, 8:55am UTC](https://discuss.elastic.co/t/how-read-or-analyze-content-of-state-st-file/100249/3 "2017-09-16T08:55:45Z")

</div>

Yes, I have backup. Thanks for your advice about hex editor.

---

<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:** [October 14, 2017, 8:56am UTC](https://discuss.elastic.co/t/how-read-or-analyze-content-of-state-st-file/100249/4 "2017-10-14T08:56:23Z")

</div>

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