# elasticsearch.exceptions.ConnectionError

**URL:** https://discuss.elastic.co/t/elasticsearch-exceptions-connectionerror/301221
**Category:** Elasticsearch
**Tags:** docker
**Created:** [March 31, 2022, 3:35pm UTC](https://discuss.elastic.co/t/elasticsearch-exceptions-connectionerror/301221 "2022-03-31T15:35:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Hammadi\_Ben\_cheikh1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hammadi_ben_cheikh1/32/103778_2.png) [@Hammadi\_Ben\_cheikh1](https://discuss.elastic.co/u/Hammadi_Ben_cheikh1)
#### Post date: [March 31, 2022, 3:35pm UTC](https://discuss.elastic.co/t/elasticsearch-exceptions-connectionerror/301221/1 "2022-03-31T15:35:29Z")

</div>

Hello my friends !  
i am working at a Django project , that use Elasticsearch , so when i transfert my project to docker container , i got this error from indexer

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bb5474e8b77e1b0116163a85f0b4e716b08ffae7.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/4/b41f191c217692b1b45a052a7d72ab0ba002a3f9.png)

**es = Elasticsearch('[http://127.0.0.1:9200/](http://127.0.0.1:9200/)')**

Please any help ! i have deadline ..

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [March 31, 2022, 4:36pm UTC](https://discuss.elastic.co/t/elasticsearch-exceptions-connectionerror/301221/2 "2022-03-31T16:36:44Z")

</div>

Is your application running in the same container that is running Elasticsearch?

If not, you need to configure the IP address of your application to point to the name of the container that is running Elasticsearch.

---

<div class="post-metadata">

### Author: ![Hammadi\_Ben\_cheikh1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hammadi_ben_cheikh1/32/103778_2.png) [@Hammadi\_Ben\_cheikh1](https://discuss.elastic.co/u/Hammadi_Ben_cheikh1)
#### Post date: [April 1, 2022, 8:44am UTC](https://discuss.elastic.co/t/elasticsearch-exceptions-connectionerror/301221/3 "2022-04-01T08:44:40Z")

</div>

Hello , Yes the project on localhost too , like Elasticsearch ,  
the project and Elasticsearch at the same container , but image indexer in other container

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [April 1, 2022, 12:35pm UTC](https://discuss.elastic.co/t/elasticsearch-exceptions-connectionerror/301221/4 "2022-04-01T12:35:23Z")

</div>

Where is this configuration set:

```auto
es = Elasticsearch('http://127.0.0.1:9200/')

```

Is this set in a service that is running in the same container as Elasticsearch?

You need to provide more context about the architecture you are using.

The error you got means that something that is running in the `imageindexerapi` can not connect to Elasticsearch container, if your Elasticsearch container is running and the service is ok, as it seems to be by the health status you shared, then there is something wrong in the configuration of your application running in the `imageindexerapi` or in the way you are starting up docker.

---

<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: [April 29, 2022, 12:36pm UTC](https://discuss.elastic.co/t/elasticsearch-exceptions-connectionerror/301221/5 "2022-04-29T12:36:12Z")

</div>

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