Traceback (most recent call last):
File "/usr/bin/curator", line 11, in
load_entry_point('elasticsearch-curator==5.7.3', 'console_scripts', 'curator')()
File "/usr/lib/python2.7/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/curator/cli.py", line 218, in cli
run(config, action_file, dry_run)
File "/usr/lib/python2.7/site-packages/curator/cli.py", line 165, in run
client = get_client(**client_args)
File "/usr/lib/python2.7/site-packages/curator/utils.py", line 906, in get_client
'Error: {0}'.format(e)
elasticsearch.exceptions.ElasticsearchException: Unable to create client connection to Elasticsearch. Error: Unknown mimetype, unable to deserialize: text/html
I installed elk with docker and want to add the curator extension, but it cannot reach Elasticsearch.
Whose docker image are you using? I highly recommend using something based on Python 3.6. Python 2.7 is literally about to be officially EOL, and there are quite a few outdated libraries which could contribute to this in non-updated, non-recent versions of Python 2.7. I recommend at least Python 2.7.10 if you are using that version. Even then, it's hit or miss.
The official package builds of Curator (RPM/DEB/Windows) are all based on Python 3.6, as it is much more up-to-date, and has many improved SSL library dependencies out of the box.
I highly recommend using the Dockerfile from Curator's GitHub repository as the basis of your Dockerfile. It gets certificates and other niceties for your container.
This means Curator expects you to provide optional [OPTIONS] and an ACTION_FILE.
If your cluster is not running on port 9200 of the local host, one of the necessary options is a configuration file, passed to the command-line as --config /path/to/FILENAME.YML.
You need to add the mapping for those on your own. Or you can use curator_cli for the entry and provide all of the values as flags, which is a common option.
I am debugging the python file. Something is strange:
In get_client method at the line 809 kwargs is containing the good configuration (curator.yml).
But when I log the "client" object, it seems to use port 443 instead of 9210.
2019-07-23 12:15:42,996 DEBUG curator.utils get_client:809 kwargs = {'hosts': ['https://elk-tst.tmhmf.net'], 'port': 9210, 'use_ssl': False, 'ssl_no_validate': False, 'master_only': False, 'url_prefix': '', 'aws_secret_key': None, 'client_cert': None, 'aws_token': None, 'http_auth': None, 'aws_sign_request': False, 'certificate': None, 'client_key': None, 'api_key': None, 'aws_key': None, 'timeout': 30}
2019-07-23 12:15:42,996 DEBUG curator.utils get_client:869 Checking for AWS settings
2019-07-23 12:15:43,000 DEBUG curator.utils get_client:887 Not using "requests_aws4auth" python module to connect.
2019-07-23 12:15:43,000 INFO curator.utils get_client:900 Instantiating client object
2019-07-23 12:15:43,001 INFO curator.utils get_client:902 Created Elasticsearch client object with provided settings
2019-07-23 12:15:43,001 INFO curator.utils get_client:907 Testing client connectivity
2019-07-23 12:15:43,001 DEBUG curator.utils get_client:908 TEMP TEST !!! <Elasticsearch([{'host': 'elk-tst.tmhmf.net', 'port': 443, 'use_ssl': True}])>
2019-07-23 12:15:43,029 ERROR curator.utils get_client:912 Unable to connect to Elasticsearch cluster. Error: Unknown mimetype, unable to deserialize: text/html
You've specified a URL, not a hostname, which you can do, but it overrides the port if you do so. This is why it changed to port 443 (you specified https in the URL). You should only have an IP or a fully-qualified domain name in the hosts array if you want to use port. Or you can keep the URL and include the port at the end of the URL. You should probably also specify use_ssl: true if you are connecting to an SSL endpoint.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.