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

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:

  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

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, where if dest references an alias, it doesn't check to see that the target index got written to.

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 :frowning:

What's not copying all the data?

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

In 5.0.2, the call was added. At the time, it was elasticsearch-py version 5.3.0.

    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 and the version requirement updated to 5.4.0.

    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.

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

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