# What should I do if the 'state' file is corrupted

**URL:** <https://discuss.elastic.co/t/what-should-i-do-if-the-state-file-is-corrupted/254999>\
**Category:** Elasticsearch\
**Created:** [November 11, 2020, 2:59am UTC](https://discuss.elastic.co/t/what-should-i-do-if-the-state-file-is-corrupted/254999 "2020-11-11T02:59:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cigarl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cigarl/32/56745_2.png) [@cigarl](https://discuss.elastic.co/u/cigarl)\
**Post date:** [November 11, 2020, 2:59am UTC](https://discuss.elastic.co/t/what-should-i-do-if-the-state-file-is-corrupted/254999/1 "2020-11-11T02:59:29Z")

</div>

When shard-data is corrupt, I can use _'reroute'_ or _'elasticSearch-shard'_ to restore the cluster, even if some data of the shard could be lost.  
But when the 'state' file is corrupted, the cluster cannot even be started. In that case, what should I do?Would I lose all my data?

by the way, a lot of times I can only see that the _'state' file-sync_ is blocked, but I don't know which directory it is.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 11, 2020, 6:09am UTC](https://discuss.elastic.co/t/what-should-i-do-if-the-state-file-is-corrupted/254999/2 "2020-11-11T06:09:31Z")

</div>

How did you end up in this situation? What type of storage are you using if you experience corruption like this? What version of Elasticsearch?

---

<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:** [December 9, 2020, 6:09am UTC](https://discuss.elastic.co/t/what-should-i-do-if-the-state-file-is-corrupted/254999/3 "2020-12-09T06:09:32Z")

</div>

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