# Repair index after too many open files error

**URL:** <https://discuss.elastic.co/t/repair-index-after-too-many-open-files-error/243542>\
**Category:** Elasticsearch\
**Created:** [August 3, 2020, 11:04am UTC](https://discuss.elastic.co/t/repair-index-after-too-many-open-files-error/243542 "2020-08-03T11:04:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hunsw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hunsw/32/93637_2.png) [@hunsw](https://discuss.elastic.co/u/hunsw)\
**Post date:** [August 3, 2020, 11:04am UTC](https://discuss.elastic.co/t/repair-index-after-too-many-open-files-error/243542/1 "2020-08-03T11:04:19Z")

</div>

We had 'too many open files' error on several nodes and even though we fixed the problem, one shard fell into a sort of a limbo.

```auto
# Relevant _cluster/allocation/explain output:
node01.example.com = {"in_sync":true,"allocation_id":"xxxx1","store_exception":{"type":"file_system_exception","reason":"/var/lib/elasticsearch/nodes/0/indices/zzzzzzzid/_state: Too many open files"}}
node02.example.com = {"in_sync":false,"allocation_id":"yyyy2"}

```

The 'usual' `POST /_cluster/reroute?retry_failed=true` API call does not allocate the shard and although the actual data -- more or less -- can be found on node01 and node02 too, it seems to differ (i.e. Lucene data, translog files, checkpoints have different file size and/or modification time).

Is there a way to force a resync without losing data? (Or w/losing as little as possible...)

---

<div class="post-metadata">

**Author:** ![hunsw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hunsw/32/93637_2.png) [@hunsw](https://discuss.elastic.co/u/hunsw)\
**Post date:** [August 4, 2020, 5:41am UTC](https://discuss.elastic.co/t/repair-index-after-too-many-open-files-error/243542/2 "2020-08-04T05:41:30Z")

</div>

A node restart (of node01) resolved the problem. It looks like the allocator was stuck because of the 'too many open files' error.

---

<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:** [September 1, 2020, 5:41am UTC](https://discuss.elastic.co/t/repair-index-after-too-many-open-files-error/243542/3 "2020-09-01T05:41:32Z")

</div>

Closed on September 1, 2020, 5:41am UTC

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