# SOLVED - Curator Problem - Workaround working but wanted to understand cause

**URL:** https://discuss.elastic.co/t/solved-curator-problem-workaround-working-but-wanted-to-understand-cause/89808
**Category:** Elasticsearch
**Created:** [June 17, 2017, 1:50pm UTC](https://discuss.elastic.co/t/solved-curator-problem-workaround-working-but-wanted-to-understand-cause/89808 "2017-06-17T13:50:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Wayne\_Taylor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wayne_taylor/32/45984_2.png) [@Wayne\_Taylor](https://discuss.elastic.co/u/Wayne_Taylor)
#### Post date: [June 17, 2017, 1:50pm UTC](https://discuss.elastic.co/t/solved-curator-problem-workaround-working-but-wanted-to-understand-cause/89808/1 "2017-06-17T13:50:38Z")

</div>

Hi All,

I am new to curator and reindexing some documents from YYYYMMDD indexes into a monthly index and also setting my shard and replica counts when creating the index.

I was getting the following error when running curator

> 2017-06-17 08:41:36,755 ERROR Failed to complete action: reindex. \<class 'curator.exceptions.FailedExecution'\>: Exception encountered. Rerun with loglevel DEBUG and/or check Elasticsearch logs for more information. Exception: 'Elasticsearch' object has no attribute 'exists\_alias

My curator yml was:

```auto
  1:
    description: "Reindex ifsrupp-* into ifsrupp-2017.05"
    action: reindex
    options:
      wait_interval: 9
      max_wait: -1
      request_body:
        source:
          index: ifsrupp-20170517
        dest:
          index: ifsrupp-2017.05
    filters:
    - filtertype: none

```

Now it does work if i add an alias for both source and destination. I didn't see this mentioned in the docs? should it be?

I got round it by adding alias on both sides.

Thanks  
Wayne

---

<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: [June 17, 2017, 3:02pm UTC](https://discuss.elastic.co/t/solved-curator-problem-workaround-working-but-wanted-to-understand-cause/89808/2 "2017-06-17T15:02:56Z")

</div>

This happened because you probably installed via `pip`, and had elasticsearch-py version 5.4.0 installed on a version of Curator before 5.1. Something weird was going on with the `exists_alias` method, but it seems to have been fixed by upgrading the python client.

In any case, the fix is to install Curator 5.1.1 (the most recent version at this time).

For reference, the [error message comes from the post check](https://github.com/elastic/curator/blob/v5.1.1/curator/actions.py#L1261), where if `dest` references an alias, it doesn't check to see that the target index got written to.

---

<div class="post-metadata">

### Author: ![Wayne\_Taylor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wayne_taylor/32/45984_2.png) [@Wayne\_Taylor](https://discuss.elastic.co/u/Wayne_Taylor)
#### Post date: [June 17, 2017, 4:02pm UTC](https://discuss.elastic.co/t/solved-curator-problem-workaround-working-but-wanted-to-understand-cause/89808/3 "2017-06-17T16:02:29Z")

</div>

I uninstalled and reinstalled and no good:

> sudo pip show elasticsearch-curator | grep Version  
> Password:  
> Version: 5.1.1  
> License: Apache License, Version 2.0

I am on 5.3.0 ES via Elasticsearch Hosted.

FYI, I just did a docker container and downloaded and whilst I didn't get the error this time its not copying all the data across ☹

---

<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: [June 17, 2017, 9:08pm UTC](https://discuss.elastic.co/t/solved-curator-problem-workaround-working-but-wanted-to-understand-cause/89808/4 "2017-06-17T21:08:20Z")

</div>

What's not copying all the data?

---

<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: [June 17, 2017, 9:36pm UTC](https://discuss.elastic.co/t/solved-curator-problem-workaround-working-but-wanted-to-understand-cause/89808/5 "2017-06-17T21:36:07Z")

</div>

So you know, here's the history of the error.

In 5.0.2, [the call was added](https://github.com/elastic/curator/blob/v5.0.2/curator/actions.py#L1141). At the time, it was elasticsearch-py version 5.3.0.

```auto
    alias_instead = self.client.exists_alias(...

```

Note that it is `self.client.exists_alias`. For consistencies sake, this call was moved to the `Indices` subsection in elasticsearch-py 5.4.0. If you upgraded to elasticsearch-py 5.4.0 and were still using Curator \< 5.1, then you would get the `'Elasticsearch' object has no attribute 'exists_alias'`, because the call had been moved. So in Curator 5.1, a [change was made to the call](https://github.com/elastic/curator/blob/v5.1.0/curator/actions.py#L1261) and the version requirement updated to 5.4.0.

```auto
    alias_instead = self.client.indices.exists_alias(name=index_name)

```

This is why an upgrade of both Curator _and_ the 5.4.0 elasticsearch-py client fixes the issue you listed.

---

<div class="post-metadata">

### Author: ![Wayne\_Taylor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wayne_taylor/32/45984_2.png) [@Wayne\_Taylor](https://discuss.elastic.co/u/Wayne_Taylor)
#### Post date: [June 17, 2017, 10:35pm UTC](https://discuss.elastic.co/t/solved-curator-problem-workaround-working-but-wanted-to-understand-cause/89808/6 "2017-06-17T22:35:13Z")

</div>

Upgrade to both works 🙂  
That was a bit of fun working out.

---

<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: [July 15, 2017, 10:35pm UTC](https://discuss.elastic.co/t/solved-curator-problem-workaround-working-but-wanted-to-understand-cause/89808/7 "2017-07-15T22:35:16Z")

</div>

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