# Cancel restore snapshot

**URL:** https://discuss.elastic.co/t/cancel-restore-snapshot/225190
**Category:** Elasticsearch
**Created:** [March 26, 2020, 12:16pm UTC](https://discuss.elastic.co/t/cancel-restore-snapshot/225190 "2020-03-26T12:16:51Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ELJIE](https://avatars.discourse-cdn.com/v4/letter/e/d9b06d/32.png) [@ELJIE](https://discuss.elastic.co/u/ELJIE)
#### Post date: [March 26, 2020, 12:16pm UTC](https://discuss.elastic.co/t/cancel-restore-snapshot/225190/1 "2020-03-26T12:16:51Z")

</div>

hello, i am doing automation tests on snapshot restore.  
I wish I could stop a restoration that is underway.  
When I execute the following command:  
`GET / _tasks / taskID `  
I have the return indicating the id and the action of my task:  
`"tasks": { "taskID": { "node": "Node1", "id": 427761143, "type": "transport", "action": "cluster: admin / snapshot / restore", "start_time_in_millis": 1585209521425, "running_time_in_nanos": 10418788830868 }`

then when launching a cancellation:  
`POST / _tasks / taskID / _cancel `  
I have the following message:  
` "reason": "task [taskID] doesn't support cancellation`  
How to stop a restore without removing the snapshot?

---

<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 26, 2020, 12:20pm UTC](https://discuss.elastic.co/t/cancel-restore-snapshot/225190/2 "2020-03-26T12:20:35Z")

</div>

You should be able to stop the restore by deleting the index that's being restored.

---

<div class="post-metadata">

### Author: ![ELJIE](https://avatars.discourse-cdn.com/v4/letter/e/d9b06d/32.png) [@ELJIE](https://discuss.elastic.co/u/ELJIE)
#### Post date: [March 26, 2020, 1:25pm UTC](https://discuss.elastic.co/t/cancel-restore-snapshot/225190/3 "2020-03-26T13:25:37Z")

</div>

Thanks to respond to me

Unfortunately when i delete the index  
`delete /index-car`  
The index is deleted and it is not restored  
However the other snapshot index continue their restoration

---

<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 26, 2020, 1:47pm UTC](https://discuss.elastic.co/t/cancel-restore-snapshot/225190/4 "2020-03-26T13:47:20Z")

</div>

Yes, if you want to cancel the restoration of multiple indices you must delete them all.

---

<div class="post-metadata">

### Author: ![ELJIE](https://avatars.discourse-cdn.com/v4/letter/e/d9b06d/32.png) [@ELJIE](https://discuss.elastic.co/u/ELJIE)
#### Post date: [March 26, 2020, 1:56pm UTC](https://discuss.elastic.co/t/cancel-restore-snapshot/225190/5 "2020-03-26T13:56:46Z")

</div>

Yes,  
this means that I have to wait until the restoration of each index is done  
and then I can delete the indexes

but I cannot use this recipe because I have too many data in the index

---

<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 26, 2020, 2:35pm UTC](https://discuss.elastic.co/t/cancel-restore-snapshot/225190/6 "2020-03-26T14:35:02Z")

</div>

I don't think that's true, I think you can delete the index while it's being restored. There is no need to wait for it to be fully restored.

---

<div class="post-metadata">

### Author: ![ELJIE](https://avatars.discourse-cdn.com/v4/letter/e/d9b06d/32.png) [@ELJIE](https://discuss.elastic.co/u/ELJIE)
#### Post date: [April 7, 2020, 8:26am UTC](https://discuss.elastic.co/t/cancel-restore-snapshot/225190/7 "2020-04-07T08:26:28Z")

</div>

Yes the recipe works  
You have to adapt a bit to recover the index being restored first and then delete it  
I have these steps scripted  
thank 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: [May 5, 2020, 8:26am UTC](https://discuss.elastic.co/t/cancel-restore-snapshot/225190/8 "2020-05-05T08:26:29Z")

</div>

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