# Delete\_snapshot action fails, get() takes at least 2 arguments (2 given)

**URL:** <https://discuss.elastic.co/t/delete-snapshot-action-fails-get-takes-at-least-2-arguments-2-given/219934>\
**Category:** Elasticsearch\
**Tags:** curator\
**Created:** [February 19, 2020, 9:51am UTC](https://discuss.elastic.co/t/delete-snapshot-action-fails-get-takes-at-least-2-arguments-2-given/219934 "2020-02-19T09:51:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![victor.nilsson](https://avatars.discourse-cdn.com/v4/letter/v/eb8c5e/32.png) [@victor.nilsson](https://discuss.elastic.co/u/victor.nilsson)\
**Post date:** [February 19, 2020, 9:51am UTC](https://discuss.elastic.co/t/delete-snapshot-action-fails-get-takes-at-least-2-arguments-2-given/219934/1 "2020-02-19T09:51:54Z")

</div>

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
      unit: months
      unit_count: 6

```

But when we run it we get the following error message:

> 2020-02-19 10:43:37,553 INFO Action ID: 1, "delete\_snapshots" completed.  
> 2020-02-19 10:43:37,553 INFO Job completed.  
> 2020-02-19 10:47:43,942 INFO Preparing Action ID: 1, "delete\_snapshots"  
> 2020-02-19 10:47:43,942 INFO Creating client object and testing connection  
> 2020-02-19 10:47:43,945 INFO Instantiating client object  
> 2020-02-19 10:47:43,945 INFO Testing client connectivity  
> 2020-02-19 10:47:43,949 INFO Successfully created Elasticsearch client object with provided settings  
> 2020-02-19 10:47:43,951 INFO Trying Action ID: 1, "delete\_snapshots": Delete snapshots older than 6 months for all logstash snapshots  
> 2020-02-19 10:47:45,268 INFO Deleting 53 selected snapshots: [u'snapshot-logstash-20190805', u'snapshot-beats-20190805', u'snapshot-system-20190805', u'snapshot-logstash-20190806', u'snapshot-beats-20190806', u'snapshot-system-20190806', u'snapshot-logstash-20190807', u'snapshot-beats-20190807', u'snapshot-system-20190807', u'snapshot-logstash-20190808', u'snapshot-beats-20190808', u'snapshot-system-20190808', u'snapshot-logstash-20190809', u'snapshot-beats-20190809', u'snapshot-system-20190809', u'snapshot-logstash-20190810', u'snapshot-beats-20190810', u'snapshot-system-20190810', u'snapshot-logstash-20190811', u'snapshot-beats-20190811', u'snapshot-system-20190811', u'snapshot-logstash-20190812', u'snapshot-beats-20190812', u'snapshot-system-20190812', u'snapshot-logstash-20190813', u'snapshot-beats-20190813', u'snapshot-system-20190813', u'snapshot-logstash-20190814', u'snapshot-beats-20190814', u'snapshot-system-20190814', u'snapshot-logstash-20190815', u'snapshot-beats-20190815', u'snapshot-system-20190815', u'snapshot-logstash-20190816', u'snapshot-beats-20190816', u'snapshot-system-20190816', u'snapshot-logstash-20190817', u'snapshot-beats-20190817', u'snapshot-system-20190817', u'snapshot-logstash-20190818', u'snapshot-beats-20190818', u'snapshot-system-20190818', u'snapshot-logstash-20190819', u'snapshot-beats-20190819', u'snapshot-logstash-20190820', u'snapshot-beats-20190820', u'snapshot-system-20190820', u'snapshot-logstash-20190821', u'snapshot-beats-20190821', u'snapshot-system-20190821', u'snapshot-logstash-20190822', u'snapshot-beats-20190822', u'snapshot-system-20190822']  
> 2020-02-19 10:47:45,922 ERROR Failed to complete action: delete\_snapshots. \<type 'exceptions.TypeError'\>: get() takes at least 2 arguments (2 given)

If i run the action with --dry-run, no errors are generated. What is the issue here?  
Curator version 5.8 in a docker container

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [February 20, 2020, 1:05am UTC](https://discuss.elastic.co/t/delete-snapshot-action-fails-get-takes-at-least-2-arguments-2-given/219934/2 "2020-02-20T01:05:22Z")

</div>

To see a bit better what's going on here, please enable DEBUG logging.

Also, what is the endpoint (cluster size? hardware/cloud?)? Is the cluster very busy? Do requests sometimes timeout or take time to return?

---

<div class="post-metadata">

**Author:** ![victor.nilsson](https://avatars.discourse-cdn.com/v4/letter/v/eb8c5e/32.png) [@victor.nilsson](https://discuss.elastic.co/u/victor.nilsson)\
**Post date:** [February 21, 2020, 7:01am UTC](https://discuss.elastic.co/t/delete-snapshot-action-fails-get-takes-at-least-2-arguments-2-given/219934/3 "2020-02-21T07:01:54Z")

</div>

I've attached the debug logs here: [https://send.firefox.com/download/ce5d02d737963bd6/#Am5RlFflO\_ue34XEAZ--wQ](https://send.firefox.com/download/ce5d02d737963bd6/#Am5RlFflO_ue34XEAZ--wQ)

Yes the cluster is very busy and timeouts do occur.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [February 21, 2020, 7:33am UTC](https://discuss.elastic.co/t/delete-snapshot-action-fails-get-takes-at-least-2-arguments-2-given/219934/4 "2020-02-21T07:33:11Z")

</div>

> `Detected Elasticsearch version 7.6.0`

How was Curator installed? There may be some API changes if you installed via `pip`, as the `elasticsearch-py` module newer than 7.1.0 may yet have some inconsistencies.

Possible remedies are to install the RPM/DEB version of Curator, or to force install version 7.1.0 of the Elasticsearch python module.

---

<div class="post-metadata">

**Author:** ![vchan2002](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vchan2002/32/46749_2.png) [@vchan2002](https://discuss.elastic.co/u/vchan2002)\
**Post date:** [February 24, 2020, 7:23pm UTC](https://discuss.elastic.co/t/delete-snapshot-action-fails-get-takes-at-least-2-arguments-2-given/219934/5 "2020-02-24T19:23:25Z")

</div>

I'm fairly sure this has to do with this bug in the elasticsearch python library. I am running into a smiliar issue where I have a lambda function that, along other things, deletes old snapshots.... That specific functionality no longer works.

> <https://github.com/elastic/elasticsearch-py/issues/1110>
>
> Elasticsearch version (bin/elasticsearch --version): 7.1.1, 7.5.1
> elasticsearch-py version (elasticsearch.\_\_versionstr\_\_): 7.5.1
> Please make sure the major version matches the Elasticsearch server you are running.
> Description...

---

<div class="post-metadata">

**Author:** ![victor.nilsson](https://avatars.discourse-cdn.com/v4/letter/v/eb8c5e/32.png) [@victor.nilsson](https://discuss.elastic.co/u/victor.nilsson)\
**Post date:** [February 25, 2020, 3:04pm UTC](https://discuss.elastic.co/t/delete-snapshot-action-fails-get-takes-at-least-2-arguments-2-given/219934/6 "2020-02-25T15:04:19Z")

</div>

I've tried installing the latest version of Curator as a DEB and still got the same error. That is with curator 5.8.1.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [February 25, 2020, 3:39pm UTC](https://discuss.elastic.co/t/delete-snapshot-action-fails-get-takes-at-least-2-arguments-2-given/219934/7 "2020-02-25T15:39:19Z")

</div>

That should not be possible. The error only exists with elasticsearch-py version 7.5.x, and the DEB package is built with elasticsearch-py version 7.1.0. If you've installed the DEB, and are launching Curator via `/usr/bin/curator`, it should not be possible to get that error.

---

<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 24, 2020, 3:39pm UTC](https://discuss.elastic.co/t/delete-snapshot-action-fails-get-takes-at-least-2-arguments-2-given/219934/8 "2020-03-24T15:39:35Z")

</div>

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