# Elastic Search Connector Fails on ca\_certs config when running in Docker

**URL:** <https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996>\
**Category:** Elastic Search\
**Tags:** docker\
**Created:** [May 7, 2024, 9:58pm UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996 "2024-05-07T21:58:00Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Crysler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_crysler/32/123421_2.png) [@Matt\_Crysler](https://discuss.elastic.co/u/Matt_Crysler)\
**Post date:** [May 7, 2024, 9:58pm UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/1 "2024-05-07T21:58:00Z")

</div>

Rather than retype the entire issue, the following topic is _exactly_ what I am running into with no resolution. I have tried everything with no luck! Can someone PLEASE respond with something that has worked for them? Thanks!

> [@Deploy python connector with docker ca\_cert parameter is not a path (run locally)](https://discuss.elastic.co/t/deploy-python-connector-with-docker-ca-cert-parameter-is-not-a-path-run-locally/340642):
>
> Hi, I have an error during the run of docker image (run connector service in docker). I have been following the instructions from [https://github.com/elastic/connectors-python/blob/main/docs/DOCKER.md](https://github.com/elastic/connectors-python/blob/main/docs/DOCKER.md) (steps: 1-5). Please see my config.yml: elasticsearch: host: https://172.22.0.2:9200 api\_key: "HERE\_IS\_MY\_AP\_KEY\_FROM\_ELASTIC\_CONFLUENCE\_CONNECTOR" ca\_certs: http\_ca.crt (i tried also with '') service: idling: 30 hearbeat: 300 max\_errors: 20 max\_errors\_span: 600 service\_type: confl…

---

<div class="post-metadata">

**Author:** ![Artem\_Shelkovnikov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/artem_shelkovnikov/32/134322_2.png) [@Artem\_Shelkovnikov](https://discuss.elastic.co/u/Artem_Shelkovnikov)\
**Post date:** [May 8, 2024, 10:10am UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/2 "2024-05-08T10:10:45Z")

</div>

Hi Matt, can you share this portion of your config (ca\_certs)? Are you running on unix?

---

<div class="post-metadata">

**Author:** ![Matt\_Crysler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_crysler/32/123421_2.png) [@Matt\_Crysler](https://discuss.elastic.co/u/Matt_Crysler)\
**Post date:** [May 8, 2024, 1:59pm UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/3 "2024-05-08T13:59:28Z")

</div>

This is the relevant line in the config. I am running on WSL2 Ubuntu on Windows but the result is the same whether I run it through WSL2 or Powershell.

elasticsearch.ca\_certs: "/home/myuser/Sandbox/http\_ca.crt"

---

<div class="post-metadata">

**Author:** ![Artem\_Shelkovnikov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/artem_shelkovnikov/32/134322_2.png) [@Artem\_Shelkovnikov](https://discuss.elastic.co/u/Artem_Shelkovnikov)\
**Post date:** [May 8, 2024, 2:31pm UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/4 "2024-05-08T14:31:32Z")

</div>

Can you try putting the certificate into the same folder where your connectors repository is pulled into and use `elasticsearch.ca_certs: "./<your_cert_file>"`?

---

<div class="post-metadata">

**Author:** ![Matt\_Crysler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_crysler/32/123421_2.png) [@Matt\_Crysler](https://discuss.elastic.co/u/Matt_Crysler)\
**Post date:** [May 8, 2024, 2:43pm UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/5 "2024-05-08T14:43:04Z")

</div>

Thanks for the suggestion. I've actually tried that exact thing with the same result. The path was as you suggested "./http\_ca.crt"

---

<div class="post-metadata">

**Author:** ![Artem\_Shelkovnikov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/artem_shelkovnikov/32/134322_2.png) [@Artem\_Shelkovnikov](https://discuss.elastic.co/u/Artem_Shelkovnikov)\
**Post date:** [May 8, 2024, 3:18pm UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/6 "2024-05-08T15:18:37Z")

</div>

Hmm, it's weird. I'm not sure how Windows Unix Subsystem functions. I would suggest in this case additionally checking file permissions of the file and the fact that the user that is running connectors is actually able to reach the file.

I checked in on EC2 instance and local MacOS machine and using `elasticsearch.ca_certs: "./<your_cert_file>"` worked for me.

Cert permissions were `-rw-r--r--`

---

<div class="post-metadata">

**Author:** ![Matt\_Crysler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_crysler/32/123421_2.png) [@Matt\_Crysler](https://discuss.elastic.co/u/Matt_Crysler)\
**Post date:** [May 8, 2024, 3:30pm UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/7 "2024-05-08T15:30:20Z")

</div>

Yeah, I even gave the cert file 777 permissions just to take that out of the equation. It seems like quite a few people have this issue though based on my searches.

---

<div class="post-metadata">

**Author:** ![Artem\_Shelkovnikov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/artem_shelkovnikov/32/134322_2.png) [@Artem\_Shelkovnikov](https://discuss.elastic.co/u/Artem_Shelkovnikov)\
**Post date:** [May 8, 2024, 3:58pm UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/8 "2024-05-08T15:58:30Z")

</div>

Since I cannot reproduce it locally I might need your help to debug this.

The code that raises it is [here](https://github.com/elastic/elastic-transport-python/blob/main/elastic_transport/_node/_http_aiohttp.py#L101-L107).

You can edit this file in your local deployment, it should be inside the connectors directory (for me it's in `lib/python3.10/site-packages/elastic_transport/_node/_http_aiohttp.py`). You can just add a `print(ca_certs)` on line 102 and see what's inside the variable.

If it's a valid path, you can try just using python and experimenting a bit by running `bin/python` and doing exactly what elastic\_transport is doing:

```auto
print(os.path.isfile(ca_certs))

```

This should give good hints on how to proceed with this problem.

---

<div class="post-metadata">

**Author:** ![Matt\_Crysler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_crysler/32/123421_2.png) [@Matt\_Crysler](https://discuss.elastic.co/u/Matt_Crysler)\
**Post date:** [May 8, 2024, 4:12pm UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/9 "2024-05-08T16:12:56Z")

</div>

I actually thought about doing that but I’m using the dockerized version of the connector so don’t have access to the source. This is through the config.yml that gets copied into the docker container on run.

I tried to go the route of building from source but was having issues with the make install command. I was using python3.12 and it didn’t seem to like that version.

---

<div class="post-metadata">

**Author:** ![Artem\_Shelkovnikov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/artem_shelkovnikov/32/134322_2.png) [@Artem\_Shelkovnikov](https://discuss.elastic.co/u/Artem_Shelkovnikov)\
**Post date:** [May 8, 2024, 4:25pm UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/10 "2024-05-08T16:25:38Z")

</div>

You should still be able to do this in the dockerized version of the connector connecting to it via `docker exec -u root -it $CONTAINER_ID /bin/sh`.

Just to double check, how do you copy the certs into the docker image?

---

<div class="post-metadata">

**Author:** ![Matt\_Crysler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_crysler/32/123421_2.png) [@Matt\_Crysler](https://discuss.elastic.co/u/Matt_Crysler)\
**Post date:** [May 8, 2024, 6:22pm UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/11 "2024-05-08T18:22:04Z")

</div>

Well, when I have the http\_ca.crt file inside the same directory as the virtual environment volume and use the path "./http\_ca.crt" as the value of the elasticsearch.ca\_certs element, I guess I figured it would have access to it without an explicit need to copy it in. Maybe that's my misunderstanding. This is the docker command I am using to run the container:

docker run -v "/home/mytest/Sandbox/connectors:/config" --rm --tty -i --network "elastic" [docker.elastic.co/enterprise-search/elastic-connectors:8.13.3.0](http://docker.elastic.co/enterprise-search/elastic-connectors:8.13.3.0) /app/bin/elastic-ingest -c /config/config.yml

---

<div class="post-metadata">

**Author:** ![Artem\_Shelkovnikov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/artem_shelkovnikov/32/134322_2.png) [@Artem\_Shelkovnikov](https://discuss.elastic.co/u/Artem_Shelkovnikov)\
**Post date:** [May 9, 2024, 10:31am UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/12 "2024-05-09T10:31:10Z")

</div>

I tried it out with docker and it worked well for me - I had to put `ca_cert: "/config/http_ca.crt"` when certificate was put into the same folder that is mounted as `:/config`.

In your case you would need certificate in `/home/mytest/Sandbox/connectors` directory and put `ca_cert: "/config/http_ca.crt"` into your config file.

---

<div class="post-metadata">

**Author:** ![Matt\_Crysler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_crysler/32/123421_2.png) [@Matt\_Crysler](https://discuss.elastic.co/u/Matt_Crysler)\
**Post date:** [May 9, 2024, 2:08pm UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/13 "2024-05-09T14:08:38Z")

</div>

Well, it won’t let me reply with my other fix but what you described was part of the problem. There was another with the ip address but I solved that. Thanks for the help!

---

<div class="post-metadata">

**Author:** ![Artem\_Shelkovnikov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/artem_shelkovnikov/32/134322_2.png) [@Artem\_Shelkovnikov](https://discuss.elastic.co/u/Artem_Shelkovnikov)\
**Post date:** [May 10, 2024, 9:38am UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/14 "2024-05-10T09:38:54Z")

</div>

Do you mind sharing what was the other problem and how you fixed it, so that we could update connectors documentation accordingly?

---

<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:** [June 7, 2024, 9:39am UTC](https://discuss.elastic.co/t/elastic-search-connector-fails-on-ca-certs-config-when-running-in-docker/358996/15 "2024-06-07T09:39:30Z")

</div>

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