Curator excution error on Elasticstack 6.2.4

Hello I am learning Elasticstack, greate tools!

Are there any good way to use “curator” to delete old data
on Elasticstack 6.2.4.

  • Whats happens

I Install Elasticstack 6.2.4 with apt-get on Debian 9, work well!
Then “apt-get install elasticsearch-curator“ and
try to delete old data.

curator --dry-run ~/.curator/action.yml

curator ~/.curator/action.yml

But I got error as followings, similar to #1089, #1186 at GitHub-elastic/curator.

  • error

curator --dry-run ~/.curator/action.yml

2018-04-30 18:51:39,331 INFO Preparing Action ID: 1, "delete_indices"
Traceback (most recent call last):
File "/usr/bin/curator", line 11, in
load_entry_point('elasticsearch-curator==4.2.5', 'console_scripts', 'curator')()
File "/usr/lib/python2.7/dist-packages/click/core.py", line 716, in call
return self.main(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/curator/cli.py", line 166, in cli
client = get_client(**client_args)
File "/usr/lib/python2.7/dist-packages/curator/utils.py", line 603, in get_client
'Error: {0}'.format(e)
elasticsearch.exceptions.ElasticsearchException: Unable to create client connection to Elasticsearch. Error: Elasticsearch version 6.2.4 incompatible with this version of Curator (6.2.4)

I read following article, etc.

Then, replace "/usr/lib/python2.7/dist-packages/curator/utils.py" to
https://github.com/elastic/curator/blob/master/curator/utils.py",
but got similar error.

  • error

curator --dry-run ~/.curator/action.yml

2018-04-30 18:54:12,705 INFO Preparing Action ID: 1, "delete_indices"
2018-04-30 18:54:12,712 ERROR Elasticsearch version 6.2.4 incompatible with this version of Curator (4.2.5)
Traceback (most recent call last):
File "/usr/bin/curator", line 11, in
load_entry_point('elasticsearch-curator==4.2.5', 'console_scripts', 'curator')()
File "/usr/lib/python2.7/dist-packages/click/core.py", line 716, in call
return self.main(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/curator/cli.py", line 166, in cli
client = get_client(**client_args)
File "/usr/lib/python2.7/dist-packages/curator/utils.py", line 901, in get_client
'Error: {0}'.format(e)
elasticsearch.exceptions.ElasticsearchException: Unable to create client connection to Elasticsearch. Error: Elasticsearch version 6.2.4 incompatible with this version of Curator (4.2.5)

Though, I am not good at programming, I comment out in
“utils.py” like this, and “curator“ work OK for now.

/usr/lib/python2.7/dist-packages/curator/utils.py

691     #if version_number >= settings.version_max() \
692     #    or version_number < settings.version_min():
693     #    logger.error(
694     #        'Elasticsearch version {0} incompatible '
695     #        'with this version of Curator '
696     #        '({1})'.format(".".join(map(str,version_number)), __version__)
697     #    )
698     #    raise CuratorException(
699     #        'Elasticsearch version {0} incompatible '
700     #        'with this version of Curator '
701     #        '({1})'.format(".".join(map(str,version_number)), __version__)
702     #    )

Are there any good way to use “curator” to delete old data
on Elasticstack 6.2.4?, thank you.

PS.
This dose not happen on Elastic Stack 5.0.2.

This is surely the wrong version of curator without adding the Debian 9 repository for Curator.

In fact, I see in the logs:

load_entry_point('elasticsearch-curator==4.2.5'

You will see this if you run curator --version

The current release of Curator is 5.5.1.

Thank you very match for reply.

curator --version
curator, version 4.2.5

Old version is used ... stuck a while, and read "Debian 9 repository"

Now, Curator work OK, thank you!

apt-get update
apt-get remove --purge elasticsearch-curator -y
cat /etc/apt/sources.list.d/elastic-6.x.list <- use this file only until now.
deb https://artifacts.elastic.co/packages/6.x/apt stable main

cat /etc/apt/sources.list.d/curator.list <- add this file !
deb [arch=amd64] https://packages.elastic.co/curator/5/debian9 stable main

apt-get update
apt-get install elasticsearch-curator -y
curator --version
curator, version 5.5.1

curator --dry-run ~/.curator/action.yml
2018-05-01 11:29:50,565 INFO Preparing Action ID: 1, "delete_indices"
2018-05-01 11:29:50,599 INFO Trying Action ID: 1, "delete_indices": Delete indices older than 45 days (based on index name), for logstash- prefixed indices. Ignore the error if the filter does not result in an actionable list of indices (ignore_empty_list) and exit cleanly.
2018-05-01 11:29:51,810 INFO DRY-RUN MODE. No changes will be made.
2018-05-01 11:29:51,811 INFO (CLOSED) indices may be shown that may not be acted on by action "delete_indices".
2018-05-01 11:29:51,814 INFO Action ID: 1, "delete_indices" completed.
2018-05-01 11:29:51,815 INFO Job completed.

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