# Can not to delete snapshots

**URL:** <https://discuss.elastic.co/t/can-not-to-delete-snapshots/220615>\
**Category:** Elasticsearch\
**Created:** [February 24, 2020, 9:49am UTC](https://discuss.elastic.co/t/can-not-to-delete-snapshots/220615 "2020-02-24T09:49:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramazan\_dd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramazan_dd/32/50393_2.png) [@Ramazan\_dd](https://discuss.elastic.co/u/Ramazan_dd)\
**Post date:** [February 24, 2020, 9:49am UTC](https://discuss.elastic.co/t/can-not-to-delete-snapshots/220615/1 "2020-02-24T09:49:32Z")

</div>

Hello, I need to delete snapshots but delete\_snapshots action does not work.  
This is my action\_file

```
actions:
  1:
    action: delete_snapshots
    description: "Delete selected snapshots from 'backup'"
    options:
      repository: backup
      retry_interval: 120
      retry_count: 3
      ignore_empty_list: True
      timeout_override: 3600
      continue_if_exception: True
    filters:
      - filtertype: pattern
        kind: regex
        value: '^logs-.*$'
      - filtertype: age
        source: name
        timestring: '%Y.%m.%d'
        direction: older
        unit: days
        unit_count: 1
  2:
    action: delete_indices
    description: "Delete indices older than 2 days"
    options:
      ignore_empty_list: True
      timeout_override:
      continue_if_exception: True
      disable_action: True
    filters:
      - filtertype: pattern
        kind: regex
        value: '^(logs-).*$'
      - filtertype: age
        source: name
        timestring: '%Y.%m.%d'
        direction: older
        unit: days
        unit_count: 2

```

error is

```
Failed to complete action: delete_snapshots. <class 'TypeError'>: get() missing 1 required positional argument: 'task_id' 

```

`/usr/local/lib/python3.6/site-packages/curator/utils.py:53: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.`

---

<div class="post-metadata">

**Author:** ![Armin\_Braun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armin_braun/32/20092_2.png) [@Armin\_Braun](https://discuss.elastic.co/u/Armin_Braun)\
**Post date:** [February 24, 2020, 11:01am UTC](https://discuss.elastic.co/t/can-not-to-delete-snapshots/220615/2 "2020-02-24T11:01:06Z")

</div>

This looks to me like a duplicate of

> [@Delete\_snapshot action fails, get() takes at least 2 arguments (2 given)](https://discuss.elastic.co/t/delete-snapshot-action-fails-get-takes-at-least-2-arguments-2-given/219934):
>
> Hi, We have the following action file for curator: --- actions: 1: action: delete\_snapshots description: \>- Delete snapshots older than 6 months for all logstash snapshots options: repository: sealikrebak01 disable\_action: False timeout\_override: 10000 ignore\_empty\_list: True filters: - filtertype: pattern kind: prefix value: snapshot- exclude: - filtertype: age source: creation\_date direction: older un…

maybe see if the suggestions in there 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:** [March 23, 2020, 11:01am UTC](https://discuss.elastic.co/t/can-not-to-delete-snapshots/220615/3 "2020-03-23T11:01:07Z")

</div>

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