# ERROR: no\_shard\_available\_action\_exception

**URL:** <https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950>\
**Category:** Elasticsearch\
**Created:** [October 19, 2022, 5:24am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950 "2022-10-19T05:24:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![hjsroldan](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@hjsroldan](https://discuss.elastic.co/u/hjsroldan)\
**Post date:** [October 19, 2022, 5:24am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950/1 "2022-10-19T05:24:37Z")

</div>

Hi,

Does someone know how to fix this issue "no\_shard\_available\_action\_exception". Encountered this error after I restore my cluster, index was restored but the documents was not restored.

Kindly see the error below:

'  
{  
"error" : {  
"root\_cause" : [  
{  
"type" : "no\_shard\_available\_action\_exception",  
"reason" : null,  
"index\_uuid" : "XGNHFe4eS-uxmtk9VbiLRA",  
"shard" : "0",  
"index" : "employees"  
}  
],  
"type" : "search\_phase\_execution\_exception",  
"reason" : "all shards failed",  
"phase" : "query",  
"grouped" : true,  
"failed\_shards" : [  
{  
"shard" : 0,  
"index" : "employees",  
"node" : null,  
"reason" : {  
"type" : "no\_shard\_available\_action\_exception",  
"reason" : null,  
"index\_uuid" : "XGNHFe4eS-uxmtk9VbiLRA",  
"shard" : "0",  
"index" : "employees"  
}  
}  
]  
},  
"status" : 503  
}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 19, 2022, 5:25am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950/2 "2022-10-19T05:25:51Z")

</div>

> [@hjsroldan](#):
>
> Encountered this error after I restore my cluster, index was restored but the documents was not restored

How did you restore it? How did you know the index was restored?

Elasticsearch doesn't seem to be able to see it, so it'd be good to understand what steps you took and what you can see.

---

<div class="post-metadata">

**Author:** ![hjsroldan](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@hjsroldan](https://discuss.elastic.co/u/hjsroldan)\
**Post date:** [October 19, 2022, 5:49am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950/3 "2022-10-19T05:49:05Z")

</div>

These are the steps that I executed:

1. REGISTER A REPOSITORY:

curl -X PUT "localhost:9200/\_snapshot/backup\_01?pretty" -H 'Content-Type: application/json' -d'  
{  
"type": "fs",  
"settings": {  
"location": "/mnt/backup"  
}  
}  
'

1. CREATE A SNAPSHOT:

curl -X PUT "localhost:9200/\_snapshot/backup\_01/snapshot\_01?wait\_for\_completion=true&pretty"

1. DELETE ALL INDEX: (To simulate data loss)

curl -XDELETE "localhost:9200/\_all"

1. RESTORE A SNAPSHOT:

curl -X POST "localhost:9200/\_snapshot/backup\_01/snapshot\_01/\_restore?pretty" -H 'Content-Type: application/json' -d'  
{  
"indices": "-.ds-.logs-deprecation.elasticsearch-default-2022.10.19-000001,-.ds-ilm-history-5-2022.10.19-000001, \*"  
}  
'

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 19, 2022, 5:52am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950/4 "2022-10-19T05:52:48Z")

</div>

Thanks!

What was the response for that restore? Can you share the output from `GET _cat/indices?v`?

---

<div class="post-metadata">

**Author:** ![hjsroldan](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@hjsroldan](https://discuss.elastic.co/u/hjsroldan)\
**Post date:** [October 19, 2022, 5:58am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950/5 "2022-10-19T05:58:43Z")

</div>

Hi @warkolm,

Here is the output,

health status index uuid pri rep docs.count docs.deleted store.size pri.store.size  
red open employees XGNHFe4eS-uxmtk9VbiLRA 1 1

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 19, 2022, 6:05am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950/6 "2022-10-19T06:05:16Z")

</div>

Thanks. It looks like your restore did not work?  
I would do a;

```auto
curl -X POST "localhost:9200/_snapshot/backup_01/snapshot_01/_restore?pretty" -H 'Content-Type: application/json' -d'
{
"indices": "employees"
}
'

```

And see what happens. Make sure you capture the response this time 🙂

---

<div class="post-metadata">

**Author:** ![hjsroldan](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@hjsroldan](https://discuss.elastic.co/u/hjsroldan)\
**Post date:** [October 19, 2022, 6:12am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950/7 "2022-10-19T06:12:08Z")

</div>

I deleted the employees index and tried to redo the restore using the curl command that you've given. Kindly see the response below:

{  
"accepted" : true  
}

After the restore I checked the indices again, however the documents in the employees index was not restored. Kindly see the output of `GET _cat/indices?v` ? below:

health status index uuid pri rep docs.count docs.deleted store.size pri.store.size  
red open employees D\_aZSE0zRNeI78dil7tOiA 1 1

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 19, 2022, 6:16am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950/8 "2022-10-19T06:16:25Z")

</div>

It'd be really great if you could share the restore request and the output.

---

<div class="post-metadata">

**Author:** ![hjsroldan](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@hjsroldan](https://discuss.elastic.co/u/hjsroldan)\
**Post date:** [October 19, 2022, 6:20am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950/9 "2022-10-19T06:20:22Z")

</div>

Here is the restore request and the output:

RESTORE REQUEST:

curl -X POST "localhost:9200/\_snapshot/backup\_01/snapshot\_01/\_restore?pretty" -H 'Content-Type: application/json' -d'  
{  
"indices": "employees"  
}  
'

OUTPUT:

{  
"accepted" : true  
}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 19, 2022, 6:22am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950/10 "2022-10-19T06:22:01Z")

</div>

Thanks. Are you sure there was documents in the snapshot? What does the output from this show;

```auto
GET _snapshot/backup_01/snapshot_01/_status

```

---

<div class="post-metadata">

**Author:** ![hjsroldan](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@hjsroldan](https://discuss.elastic.co/u/hjsroldan)\
**Post date:** [October 19, 2022, 6:28am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950/11 "2022-10-19T06:28:12Z")

</div>

Here is the output:

```auto
{
   "snapshots":[
      {
         "snapshot":"snapshot_01",
         "repository":"backup_01",
         "uuid":"UT5wbIXiTp-HpcEwDGF-bA",
         "state":"SUCCESS",
         "include_global_state":true,
         "shards_stats":{
            "initializing":0,
            "started":0,
            "finalizing":0,
            "done":3,
            "failed":0,
            "total":3
         },
         "stats":{
            "incremental":{
               "file_count":27,
               "size_in_bytes":69427
            },
            "total":{
               "file_count":27,
               "size_in_bytes":69427
            },
            "start_time_in_millis":1666156245588,
            "time_in_millis":643
         },
         "indices":{
            ".ds-.logs-deprecation.elasticsearch-default-2022.10.19-000001":{
               "shards_stats":{
                  "initializing":0,
                  "started":0,
                  "finalizing":0,
                  "done":1,
                  "failed":0,
                  "total":1
               },
               "stats":{
                  "incremental":{
                     "file_count":13,
                     "size_in_bytes":41254
                  },
                  "total":{
                     "file_count":13,
                     "size_in_bytes":41254
                  },
                  "start_time_in_millis":1666156245789,
                  "time_in_millis":442
               },
               "shards":{
                  "0":{
                     "stage":"DONE",
                     "stats":{
                        "incremental":{
                           "file_count":13,
                           "size_in_bytes":41254
                        },
                        "total":{
                           "file_count":13,
                           "size_in_bytes":41254
                        },
                        "start_time_in_millis":1666156245789,
                        "time_in_millis":442
                     }
                  }
               }
            },
            ".ds-ilm-history-5-2022.10.19-000001":{
               "shards_stats":{
                  "initializing":0,
                  "started":0,
                  "finalizing":0,
                  "done":1,
                  "failed":0,
                  "total":1
               },
               "stats":{
                  "incremental":{
                     "file_count":7,
                     "size_in_bytes":19258
                  },
                  "total":{
                     "file_count":7,
                     "size_in_bytes":19258
                  },
                  "start_time_in_millis":1666156245789,
                  "time_in_millis":240
               },
               "shards":{
                  "0":{
                     "stage":"DONE",
                     "stats":{
                        "incremental":{
                           "file_count":7,
                           "size_in_bytes":19258
                        },
                        "total":{
                           "file_count":7,
                           "size_in_bytes":19258
                        },
                        "start_time_in_millis":1666156245789,
                        "time_in_millis":240
                     }
                  }
               }
            },
            "employees":{
               "shards_stats":{
                  "initializing":0,
                  "started":0,
                  "finalizing":0,
                  "done":1,
                  "failed":0,
                  "total":1
               },
               "stats":{
                  "incremental":{
                     "file_count":7,
                     "size_in_bytes":8915
                  },
                  "total":{
                     "file_count":7,
                     "size_in_bytes":8915
                  },
                  "start_time_in_millis":1666156245789,
                  "time_in_millis":240
               },
               "shards":{
                  "0":{
                     "stage":"DONE",
                     "stats":{
                        "incremental":{
                           "file_count":7,
                           "size_in_bytes":8915
                        },
                        "total":{
                           "file_count":7,
                           "size_in_bytes":8915
                        },
                        "start_time_in_millis":1666156245789,
                        "time_in_millis":240
                     }
                  }
               }
            }
         }
      }
   ]
}[

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 19, 2022, 8:44am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950/12 "2022-10-19T08:44:42Z")

</div>

It doesn't look like your original index had any data in it from what I can see, that appears to be an empty index that was snapshotted.

(Also please format your code/logs/config using the `</>` button, or markdown style back ticks. It helps to make things easy to read which helps us help you 🙂 )

---

<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:** [November 16, 2022, 8:45am UTC](https://discuss.elastic.co/t/error-no-shard-available-action-exception/316950/13 "2022-11-16T08:45:18Z")

</div>

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