# Possible to manually delete S3 backup repository?

**URL:** <https://discuss.elastic.co/t/possible-to-manually-delete-s3-backup-repository/101402>\
**Category:** Elasticsearch\
**Created:** [September 21, 2017, 11:03pm UTC](https://discuss.elastic.co/t/possible-to-manually-delete-s3-backup-repository/101402 "2017-09-21T23:03:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Hannigan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_hannigan/32/22401_2.png) [@Patrick\_Hannigan](https://discuss.elastic.co/u/Patrick_Hannigan)\
**Post date:** [September 21, 2017, 11:03pm UTC](https://discuss.elastic.co/t/possible-to-manually-delete-s3-backup-repository/101402/1 "2017-09-21T23:03:54Z")

</div>

Hi all - we've started backing up our elasticsearch cluster into a new S3 bucket/repo and would like to delete the previous bucket/repo that we were using. However, when we try to delete the old repo, we're getting the error:

```
{"error":{"root_cause":[{"type":"remote_transport_exception","reason":"[MASTER-ip-10-0-0-71][10.0.0.71:9300][cluster:admin/repository/delete]"}],"type":"illegal_state_exception","reason":"trying to modify or unregister repository that is currently used "},"status":500}

```

We've found that there's a stuck partial restore from months ago that we can't seem to cancel.

We don't care about that restore or this repo. Can we safely just delete the S3 bucket and manually delete the pointers to it on the elasticsearch side?

Any ideas are greatly appreciated!

Patrick

Edit: at the suggestion of Elastic support, I've also opened up an issue on Github: [https://github.com/elastic/elasticsearch/issues/26917](https://github.com/elastic/elasticsearch/issues/26917)

---

<div class="post-metadata">

**Author:** ![Patrick\_Hannigan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_hannigan/32/22401_2.png) [@Patrick\_Hannigan](https://discuss.elastic.co/u/Patrick_Hannigan)\
**Post date:** [September 25, 2017, 1:51pm UTC](https://discuss.elastic.co/t/possible-to-manually-delete-s3-backup-repository/101402/2 "2017-09-25T13:51:12Z")

</div>

Bumping this to see if anyone has insight into the problems we're encountering above.

---

<div class="post-metadata">

**Author:** ![tanguy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy/32/6030_2.png) [@tanguy](https://discuss.elastic.co/u/tanguy)\
**Post date:** [October 10, 2017, 7:26am UTC](https://discuss.elastic.co/t/possible-to-manually-delete-s3-backup-repository/101402/3 "2017-10-10T07:26:52Z")

</div>

Hi Patrick,

I saw your issue on Github: [https://github.com/elastic/elasticsearch/issues/26917](https://github.com/elastic/elasticsearch/issues/26917)

On 2.1.1, I think that the only way to get rid of this stuck restore task is to restart the cluster. After the restart, you should be able to delete the repository on Elasticsearch and then on S3.

---

<div class="post-metadata">

**Author:** ![Patrick\_Hannigan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_hannigan/32/22401_2.png) [@Patrick\_Hannigan](https://discuss.elastic.co/u/Patrick_Hannigan)\
**Post date:** [October 10, 2017, 2:57pm UTC](https://discuss.elastic.co/t/possible-to-manually-delete-s3-backup-repository/101402/4 "2017-10-10T14:57:07Z")

</div>

@tanguy I've rolling-restarted all the nodes on our cluster and I'm still seeing the restore in state 'STARTED' when I visit [http://elasticsearch.hive.co:9200/\_cluster/state/customs](http://elasticsearch.hive.co:9200/_cluster/state/customs)

Is there anything else I need to do to clear out the restore? Anything I'm missing here?

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![tanguy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy/32/6030_2.png) [@tanguy](https://discuss.elastic.co/u/tanguy)\
**Post date:** [October 11, 2017, 11:43am UTC](https://discuss.elastic.co/t/possible-to-manually-delete-s3-backup-repository/101402/5 "2017-10-11T11:43:22Z")

</div>

Can you please share the JSON part from /\_cluster/state/customs that concerns the stucked restore please?

---

<div class="post-metadata">

**Author:** ![Patrick\_Hannigan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_hannigan/32/22401_2.png) [@Patrick\_Hannigan](https://discuss.elastic.co/u/Patrick_Hannigan)\
**Post date:** [October 11, 2017, 2:21pm UTC](https://discuss.elastic.co/t/possible-to-manually-delete-s3-backup-repository/101402/6 "2017-10-11T14:21:59Z")

</div>

Here's the output: [https://gist.github.com/patmanh/50695e4c5d46db7ede49706309602052](https://gist.github.com/patmanh/50695e4c5d46db7ede49706309602052)

---

<div class="post-metadata">

**Author:** ![Patrick\_Hannigan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_hannigan/32/22401_2.png) [@Patrick\_Hannigan](https://discuss.elastic.co/u/Patrick_Hannigan)\
**Post date:** [October 16, 2017, 3:40pm UTC](https://discuss.elastic.co/t/possible-to-manually-delete-s3-backup-repository/101402/7 "2017-10-16T15:40:25Z")

</div>

@tanguy any more ideas on your end? Thanks!

---

<div class="post-metadata">

**Author:** ![tanguy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy/32/6030_2.png) [@tanguy](https://discuss.elastic.co/u/tanguy)\
**Post date:** [October 19, 2017, 8:55am UTC](https://discuss.elastic.co/t/possible-to-manually-delete-s3-backup-repository/101402/8 "2017-10-19T08:55:03Z")

</div>

I think that the only solution to get rid of this stucked snapshot is to do a full cluster restart, ie shutdown all your nodes and start them again.

---

<div class="post-metadata">

**Author:** ![Patrick\_Hannigan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_hannigan/32/22401_2.png) [@Patrick\_Hannigan](https://discuss.elastic.co/u/Patrick_Hannigan)\
**Post date:** [October 19, 2017, 1:29pm UTC](https://discuss.elastic.co/t/possible-to-manually-delete-s3-backup-repository/101402/9 "2017-10-19T13:29:40Z")

</div>

@tanguy got it. Can you forsee any obvious complications if we leave the stuck snapshot, and just delete the bucket from S3?

---

<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, 2017, 1:30pm UTC](https://discuss.elastic.co/t/possible-to-manually-delete-s3-backup-repository/101402/10 "2017-11-16T13:30:23Z")

</div>

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