# Open closed index, inconsistent status

**URL:** https://discuss.elastic.co/t/open-closed-index-inconsistent-status/219607
**Category:** Elasticsearch
**Created:** [February 17, 2020, 12:00pm UTC](https://discuss.elastic.co/t/open-closed-index-inconsistent-status/219607 "2020-02-17T12:00:37Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Miguel1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel1/32/82094_2.png) [@Miguel1](https://discuss.elastic.co/u/Miguel1)
#### Post date: [February 17, 2020, 12:00pm UTC](https://discuss.elastic.co/t/open-closed-index-inconsistent-status/219607/1 "2020-02-17T12:00:37Z")

</div>

Hi, folks!  
(my Elasticsearch version is 7.5.2)  
I have a closed index called " **vpn-2019.52**", a weekly vpn index and when I try to open it with:  
`POST vpn-2019.52/_open`  
It timed out and reported nothing. After that I found my index on the following situation:  
Its status is **health: green, status: close** and a primary - replica assigned.  
I try to query the index and it and I get:  
**Query:**

```
POST vpn-2019-52/_search
{
  "query": {
    "match_all": {}
  }
}

```

**Response:**  
`{ "error" : { "root_cause" : [{ "type" : "index_not_found_exception", "reason" : "no such index [vpn-2019-52]", "resource.type" : "index_or_alias", "resource.id" : "vpn-2019-52", "index_uuid" : "_na_", "index" : "vpn-2019-52" } ], "type" : "index_not_found_exception", "reason" : "no such index [vpn-2019-52]", "resource.type" : "index_or_alias", "resource.id" : "vpn-2019-52", "index_uuid" : "_na_", "index" : "vpn-2019-52" }, "status" : 404 }`  
There are no **pending\_tasks** and the **thread pool** has active threads only at management:  
`elastic-03-0 management 1 0 0`  
`elastic-01-0 management 1 0 0`  
`elastic-02-0 management 1 0 0`  
**GET /\_cluster/health/vpn-2019-52?level=shards**  
` "vpn-2019.52" : { "status" : "green", "number_of_shards" : 1, "number_of_replicas" : 1, "active_primary_shards" : 1, "active_shards" : 2, "relocating_shards" : 0, "initializing_shards" : 0, "unassigned_shards" : 0, "shards" : { "0" : { "status" : "green", "primary_active" : true, "active_shards" : 2, "relocating_shards" : 0, "initializing_shards" : 0, "unassigned_shards" : 0 } } }`  
**\_recovery** gives me same error as **\_search**  
Is there anything I can do to recover this index?  
Thank you in advance.

---

<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: [February 17, 2020, 12:59pm UTC](https://discuss.elastic.co/t/open-closed-index-inconsistent-status/219607/2 "2020-02-17T12:59:12Z")

</div>

I think that an `index_not_found_exception` is the expected response when trying to search a closed index. From the point of view of searches, closed indices don't even exist.

You say that you tried to open it, but that this timed out. This seems to be the fundamental issue. Can you share more detail on that? For instance, can you share the logs from this time?

---

<div class="post-metadata">

### Author: ![Miguel1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel1/32/82094_2.png) [@Miguel1](https://discuss.elastic.co/u/Miguel1)
#### Post date: [February 17, 2020, 1:42pm UTC](https://discuss.elastic.co/t/open-closed-index-inconsistent-status/219607/3 "2020-02-17T13:42:09Z")

</div>

Hi, David!  
When you query a closed index, Don't you receive the following message?  
`{ "error": { "root_cause": [{ "type": "index_closed_exception", "reason": "closed", "index_uuid": "dxgwJCHiSEWKtXtAjqqwEQ", "index": "test" }], "type": "index_closed_exception", "reason": "closed", "index_uuid": "dxgwJCHiSEWKtXtAjqqwEQ", "index": "test" }, "status": 400 }`  
That's the one I expected. I've checked the three nodes of the cluster and no logs were written about that index. By the way, I've solved it restarting the cluster, closing the index and opening it again. But sometimes a cluster restart is not possible. Any hint about what else could I check, please?

---

<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: [February 17, 2020, 1:46pm UTC](https://discuss.elastic.co/t/open-closed-index-inconsistent-status/219607/4 "2020-02-17T13:46:46Z")

</div>

the index you searched did not have a dot in the name, which the one you opened did.

---

<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: [February 17, 2020, 1:55pm UTC](https://discuss.elastic.co/t/open-closed-index-inconsistent-status/219607/5 "2020-02-17T13:55:15Z")

</div>

Ah yes you're quite right, we handle that as a special case with `index_closed_exception`. As eagle-eyed Christian points out, the index you're trying to search doesn't exist indeed.

---

<div class="post-metadata">

### Author: ![Miguel1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/miguel1/32/82094_2.png) [@Miguel1](https://discuss.elastic.co/u/Miguel1)
#### Post date: [February 17, 2020, 2:53pm UTC](https://discuss.elastic.co/t/open-closed-index-inconsistent-status/219607/6 "2020-02-17T14:53:15Z")

</div>

My apologies, when I pasted my queries I deleted our client identifier and by mistake deleted the date pattern. But I used the right one, sorry.

---

<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: [March 16, 2020, 2:53pm UTC](https://discuss.elastic.co/t/open-closed-index-inconsistent-status/219607/7 "2020-03-16T14:53:24Z")

</div>

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