# Accidentally deleted Index- Error: failed to find metadata for existing index

**URL:** https://discuss.elastic.co/t/accidentally-deleted-index-error-failed-to-find-metadata-for-existing-index/197983
**Category:** Elasticsearch
**Created:** [September 4, 2019, 6:29am UTC](https://discuss.elastic.co/t/accidentally-deleted-index-error-failed-to-find-metadata-for-existing-index/197983 "2019-09-04T06:29:49Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![rajatrj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajatrj16/32/52875_2.png) [@rajatrj16](https://discuss.elastic.co/u/rajatrj16)
#### Post date: [September 4, 2019, 6:29am UTC](https://discuss.elastic.co/t/accidentally-deleted-index-error-failed-to-find-metadata-for-existing-index/197983/1 "2019-09-04T06:29:49Z")

</div>

I have accidentally deleted 2-3 indexes form path: `elasticsearch/data/nodes/0`  
And now I can't able to restart the elastic search.

It gives me the error:  
`Caused by: java.io.IOException: failed to find metadata for existing index SOME_INDEX-2019.09.01-1 [location: AbMOLZfgdfsuaOQILdHbTiQ, generation: 29]`

How do I solve this?

[Related Issue](https://discuss.elastic.co/t/failed-to-find-metadata-for-existing-index/179190)  
I did not find here exactly what to do!!! 😔

---

<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: [September 4, 2019, 6:41am UTC](https://discuss.elastic.co/t/accidentally-deleted-index-error-failed-to-find-metadata-for-existing-index/197983/2 "2019-09-04T06:41:01Z")

</div>

The only supported way forwards is to delete the rest of `elasticsearch/data/nodes/0`. This will allow this node to start up. If your cluster health is `yellow` or `green` then Elasticsearch will be able to recover any missing shards from the other nodes in your cluster. If your cluster health is `red` then you might need to restore any missing data from snapshots.

---

<div class="post-metadata">

### Author: ![rajatrj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajatrj16/32/52875_2.png) [@rajatrj16](https://discuss.elastic.co/u/rajatrj16)
#### Post date: [September 4, 2019, 6:44am UTC](https://discuss.elastic.co/t/accidentally-deleted-index-error-failed-to-find-metadata-for-existing-index/197983/3 "2019-09-04T06:44:30Z")

</div>

Is there any way I can restore all data, deleting the nodes will delete all the data right?

also we do not have any other node currently, we have working on a single node right now.

---

<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: [September 4, 2019, 6:48am UTC](https://discuss.elastic.co/t/accidentally-deleted-index-error-failed-to-find-metadata-for-existing-index/197983/5 "2019-09-04T06:48:29Z")

</div>

Yes, if this was a one-node cluster then you will have to delete the whole cluster and restore from a snapshot.

---

<div class="post-metadata">

### Author: ![rajatrj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajatrj16/32/52875_2.png) [@rajatrj16](https://discuss.elastic.co/u/rajatrj16)
#### Post date: [September 4, 2019, 7:16am UTC](https://discuss.elastic.co/t/accidentally-deleted-index-error-failed-to-find-metadata-for-existing-index/197983/6 "2019-09-04T07:16:33Z")

</div>

one last thing, when you talk about restoring from snapshot, is it AMI\SNAPSHOT taken by AWS\AZURE, or elasticsearch takes backup by itself.

---

<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: [September 4, 2019, 7:24am UTC](https://discuss.elastic.co/t/accidentally-deleted-index-error-failed-to-find-metadata-for-existing-index/197983/7 "2019-09-04T07:24:34Z")

</div>

I am talking about a snapshot that you have previously taken using [Elasticsearch's snapshot/restore functionality](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html). Filesystem-level snapshots offered by services like AWS and Azure are not something that is tested or supported - they definitely do not work if you have more than one node.

---

<div class="post-metadata">

### Author: ![rajatrj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajatrj16/32/52875_2.png) [@rajatrj16](https://discuss.elastic.co/u/rajatrj16)
#### Post date: [September 4, 2019, 10:43am UTC](https://discuss.elastic.co/t/accidentally-deleted-index-error-failed-to-find-metadata-for-existing-index/197983/8 "2019-09-04T10:43:17Z")

</div>

Guess I haven't took any snapshot before, So in that case, If I restart or delete whole cluster, It will delete all my data on ES right away.

Is there any way i can fetch/restore, or take any other actions to prevent my data, can't afford to loose them.

---

<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: [September 4, 2019, 11:03am UTC](https://discuss.elastic.co/t/accidentally-deleted-index-error-failed-to-find-metadata-for-existing-index/197983/9 "2019-09-04T11:03:24Z")

</div>

I don't have any other suggestions to offer.

---

<div class="post-metadata">

### Author: ![rajatrj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajatrj16/32/52875_2.png) [@rajatrj16](https://discuss.elastic.co/u/rajatrj16)
#### Post date: [September 4, 2019, 11:25am UTC](https://discuss.elastic.co/t/accidentally-deleted-index-error-failed-to-find-metadata-for-existing-index/197983/10 "2019-09-04T11:25:29Z")

</div>

Deleted indices, but when I am restarting `./bin/elasticsearch` it gives error: `[2019-09-04T16:53:35,773][INFO][o.e.x.s.a.AuthenticationService] [elk] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]`

This is due to x-pack that I know but how to resolve this?

---

<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: [September 4, 2019, 11:33am UTC](https://discuss.elastic.co/t/accidentally-deleted-index-error-failed-to-find-metadata-for-existing-index/197983/11 "2019-09-04T11:33:07Z")

</div>

Sorry, I don't know what would cause that. I suggest opening another thread since this is a different issue from the one we were originally discussing.

---

<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 2, 2019, 11:33am UTC](https://discuss.elastic.co/t/accidentally-deleted-index-error-failed-to-find-metadata-for-existing-index/197983/12 "2019-10-02T11:33:07Z")

</div>

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