# Two unassigned shards as failed to create engine with error no such file exception

**URL:** <https://discuss.elastic.co/t/two-unassigned-shards-as-failed-to-create-engine-with-error-no-such-file-exception/173480>\
**Category:** Elasticsearch\
**Created:** [March 22, 2019, 11:01am UTC](https://discuss.elastic.co/t/two-unassigned-shards-as-failed-to-create-engine-with-error-no-such-file-exception/173480 "2019-03-22T11:01:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![piyush1337](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@piyush1337](https://discuss.elastic.co/u/piyush1337)\
**Post date:** [March 22, 2019, 11:01am UTC](https://discuss.elastic.co/t/two-unassigned-shards-as-failed-to-create-engine-with-error-no-such-file-exception/173480/1 "2019-03-22T11:01:37Z")

</div>

Hi,

I am getting two shards unassigned and obviously the status is "RED"

I ran a cluster explanation API

failed shard on node [6PiZfydPRRi06v\_8oISQaA]: failed recovery, failure RecoveryFailedException[[wazuh-archives-3.x-2019.03.21][0]: Recovery failed on {6PiZfyd}{6PiZfydPRRi06v\_8oISQaA}{33L5TeBQRuqy7zQGXmLkNQ}{127.0.0.1}{127.0.0.1:9300}{ml.machine\_memory=8112173056, xpack.installed=true, ml.max\_open\_jobs=20, ml.enabled=true}]; nested: IndexShardRecoveryException[failed to recover from gateway]; nested: EngineCreationFailureException[failed to create engine]; nested: NoSuchFileException[/mnt/externaldrive/elasticsearch/nodes/0/indices/HMhWfsmASrevHvF6c8zE9g/0/index/\_o76.si];

"allocate\_explanation" : "cannot allocate because allocation is not permitted to any of the nodes that hold an in-sync shard copy"

shard has exceeded the maximum number of retries [5] on failed allocation attempts - manually call [/\_cluster/reroute?retry\_failed=true] to retry, [unassigned\_info[[reason=ALLOCATION\_FAILED], at[2019-03-22T08:41:01.378Z], failed\_attempts[5], delayed=false, details[failed shard on node [6PiZfydPRRi06v\_8oISQaA]: failed recovery, failure RecoveryFailedException[[wazuh-archives-3.x-2019.03.21][0]: Recovery failed on {6PiZfyd}{6PiZfydPRRi06v\_8oISQaA}{33L5TeBQRuqy7zQGXmLkNQ}{127.0.0.1}{127.0.0.1:9300}{ml.machine\_memory=8112173056, xpack.installed=true, ml.max\_open\_jobs=20, ml.enabled=true}]; nested: IndexShardRecoveryException[failed to recover from gateway]; nested: EngineCreationFailureException[failed to create engine]; nested: NoSuchFileException[/mnt/externaldrive/elasticsearch/nodes/0/indices/HMhWfsmASrevHvF6c8zE9g/0/index/\_o76.si]; ], allocation\_status[deciders\_no]]]

I have manually called /\_cluster/reroute?retry\_failed=true via curl multiple times but no luck and now i am stuck at this please help me in this.

Thanks

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 22, 2019, 2:50pm UTC](https://discuss.elastic.co/t/two-unassigned-shards-as-failed-to-create-engine-with-error-no-such-file-exception/173480/2 "2019-03-22T14:50:34Z")

</div>

> [@piyush1337](#):
>
> `NoSuchFileException[/mnt/externaldrive/elasticsearch/nodes/0/indices/HMhWfsmASrevHvF6c8zE9g/0/index/_o76.si]`

If this file is really not there, I don't think there's a way to recover this shard. The best way forward is to restore it from a recent snapshot.

---

<div class="post-metadata">

**Author:** ![piyush1337](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@piyush1337](https://discuss.elastic.co/u/piyush1337)\
**Post date:** [March 25, 2019, 6:04am UTC](https://discuss.elastic.co/t/two-unassigned-shards-as-failed-to-create-engine-with-error-no-such-file-exception/173480/3 "2019-03-25T06:04:11Z")

</div>

May i know the reason for this ?? Like why and how did it happen ?? what's the cause?

As i got it on my testing server and i don't have snapshot but if it happens in production it would be a big problem so i want to know what causes this so that i can take preventive measures.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 25, 2019, 7:53am UTC](https://discuss.elastic.co/t/two-unassigned-shards-as-failed-to-create-engine-with-error-no-such-file-exception/173480/4 "2019-03-25T07:53:11Z")

</div>

It's hard to say. Something deleted this file, but it wasn't Elasticsearch. You should prevent things from deleting files managed by 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:** [April 22, 2019, 7:53am UTC](https://discuss.elastic.co/t/two-unassigned-shards-as-failed-to-create-engine-with-error-no-such-file-exception/173480/5 "2019-04-22T07:53:17Z")

</div>

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