# Docker Curator is not working

**URL:** <https://discuss.elastic.co/t/docker-curator-is-not-working/191341>\
**Category:** Elasticsearch\
**Tags:** curator\
**Created:** [July 19, 2019, 7:51am UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341 "2019-07-19T07:51:33Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![pred](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@pred](https://discuss.elastic.co/u/pred)\
**Post date:** [July 19, 2019, 7:51am UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341/1 "2019-07-19T07:51:34Z")

</div>

Hello,

I got the exact same issue of this post :

> [@Curator is not working after enable TLS/SSL in 5.6 version](https://discuss.elastic.co/t/curator-is-not-working-after-enable-tls-ssl-in-5-6-version/168813):
>
> All, curator snapshot backups are not working after enable TLS/SSL and we see below errors when we test with dry run Traceback (most recent call last): File "/bin/curator", line 11, in \<module\> sys.exit(cli()) 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 89…

Which is :

> 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.

Do someone have a clue to solve this issue ?

---

<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:** [July 19, 2019, 9:52am UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341/2 "2019-07-19T09:52:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pred](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@pred](https://discuss.elastic.co/u/pred)\
**Post date:** [July 19, 2019, 12:22pm UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341/3 "2019-07-19T12:22:17Z")

</div>

Hi !

Thanks for your help.

I will try to upgrade Python's version.

Here's my Dockerfile in case you need to see it :

> FROM alpine:3.8
> 
> ENV CURATOR\_VERSION=5.7.3
> 
> RUN apk --update add --no-cache tini python py-pip   
> && pip install elasticsearch-curator==${CURATOR\_VERSION}
> 
> COPY entrypoint.sh /  
> RUN chmod +x /entrypoint.sh
> 
> WORKDIR /usr/share/curator  
> COPY config ./config
> 
> ENTRYPOINT ["/entrypoint.sh"]

---

<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:** [July 19, 2019, 12:36pm UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341/4 "2019-07-19T12:36:31Z")

</div>

I highly recommend using the Dockerfile from [Curator's GitHub repository](https://github.com/elastic/curator) as the basis of your Dockerfile. It gets certificates and other niceties for your container.

---

<div class="post-metadata">

**Author:** ![pred](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@pred](https://discuss.elastic.co/u/pred)\
**Post date:** [July 23, 2019, 6:36am UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341/5 "2019-07-23T06:36:09Z")

</div>

Hi,

First, thank you so much for your reply.  
I installed the curator from the gitHub repository you had mentioned.

But I do not see how to start it with cron and parameters in the readme file.  
Plus, I got the following error in my container logs :

> Usage: curator [OPTIONS] ACTION\_FILE
> 
> Error: Missing argument "action\_file".

---

<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:** [July 23, 2019, 6:53am UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341/6 "2019-07-23T06:53:05Z")

</div>

This means Curator expects you to provide optional [`[OPTIONS]`](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.7/command-line.html) and an [`ACTION_FILE`](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.7/actionfile.html).

If your cluster is not running on port 9200 of the local host, one of the necessary options is a [configuration file](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.7/configfile.html), passed to the command-line as `--config /path/to/FILENAME.YML`.

As for cron, here's a [tutorial](https://www.ostechnix.com/a-beginners-guide-to-cron-jobs/).

---

<div class="post-metadata">

**Author:** ![pred](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@pred](https://discuss.elastic.co/u/pred)\
**Post date:** [July 23, 2019, 8:36am UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341/7 "2019-07-23T08:36:53Z")

</div>

I'm sorry, I know I'm missing something but I still not see how to give action\_file.yml and curator.yml to the container.

I searched where the "curator --config curator.yml action\_file" is launch in the GitHub project but I didn't found it.

I tried to launch docker-compose command with some environment variables like ACTION\_FILE but it still not work.

For the curator.yml file I have the solution to create the default ~/.curator/curator.yml.  
But there is no default file for action\_file.

---

<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:** [July 23, 2019, 9:04am UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341/8 "2019-07-23T09:04:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pred](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@pred](https://discuss.elastic.co/u/pred)\
**Post date:** [July 23, 2019, 9:33am UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341/9 "2019-07-23T09:33:50Z")

</div>

Ok I get it.  
I keept the command entrypoint of github and add my own action\_file.yml.

> ENTRYPOINT ["/curator/curator", "/usr/share/curator/config/action\_file.yml"]

But I'm back on the error I had first:

> 2019-07-23 09:26:21,943 INFO curator.utils get\_client:907 Testing client connectivity  
> 2019-07-23 09:26:21,971 ERROR curator.utils get\_client:911 Unable to connect to Elasticsearch cluster. Error: Unknown mimetype, unable to deserialize: text/html  
> 2019-07-23 09:26:21,971 CRITICAL curator.utils get\_client:912 Curator cannot proceed. Exiting.

Weird because I'm using the same network than elasticsearch...

---

<div class="post-metadata">

**Author:** ![pred](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@pred](https://discuss.elastic.co/u/pred)\
**Post date:** [July 23, 2019, 12:19pm UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341/10 "2019-07-23T12:19:38Z")

</div>

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](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](http://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

---

<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:** [July 23, 2019, 10:27pm UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341/11 "2019-07-23T22:27:48Z")

</div>

> [@pred](#):
>
> {'hosts': ['[https://elk-tst.tmhmf.net](https://elk-tst.tmhmf.net)'], 'port': 9210,

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.

---

<div class="post-metadata">

**Author:** ![pred](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@pred](https://discuss.elastic.co/u/pred)\
**Post date:** [July 24, 2019, 12:26pm UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341/12 "2019-07-24T12:26:25Z")

</div>

It finally works !!!

Thank you so much !

---

<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:** [August 21, 2019, 12:26pm UTC](https://discuss.elastic.co/t/docker-curator-is-not-working/191341/13 "2019-08-21T12:26:27Z")

</div>

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