Open closed index, inconsistent status

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:

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

{ "error" : { "root_cause" : [ { "type" : "index_not_found_exception", "reason" : "no such index [vpn-2019-52]", "resource.type" : "index_or_alias", "" : "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", "" : "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.


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?

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?

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

1 Like

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.

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.

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