# Elasticsearch With Node.js throwing an Error: connect EADDRNOTAVAIL

**URL:** <https://discuss.elastic.co/t/elasticsearch-with-node-js-throwing-an-error-connect-eaddrnotavail/294495>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [January 16, 2022, 10:00am UTC](https://discuss.elastic.co/t/elasticsearch-with-node-js-throwing-an-error-connect-eaddrnotavail/294495 "2022-01-16T10:00:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![qadeer.sipra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/qadeer.sipra/32/100368_2.png) [@qadeer.sipra](https://discuss.elastic.co/u/qadeer.sipra)\
**Post date:** [January 16, 2022, 10:00am UTC](https://discuss.elastic.co/t/elasticsearch-with-node-js-throwing-an-error-connect-eaddrnotavail/294495/1 "2022-01-16T10:00:58Z")

</div>

I am using Elasticsearch6.8.3 docker on an AWS ec2 machine for the production environment. For this purpose, I have installed the Elasticsearch via docker compose. In a microservice architecture many of the other services using different languages like PHP and Python, are just working fine. But When it comes to Node.js client it starts throwing this error :

```auto
Connect EADDRNOTAVAIL IP_ADDRESS:9200 - Local (IP_ADDRESS:0)
at onResponse (/var/app/current/node_modules/@elastic/elasticsearch/lib/Transport.js:228:13)
at ClientRequest.<anonymous> 
(/var/app/current/node_modules/@elastic/elasticsearch/lib/Connection.js:113:9)
at ClientRequest.emit (events.js:314:20)
at ClientRequest.EventEmitter.emit (domain.js:483:12)
at Socket.socketErrorListener (_http_client.js:427:9)
at Socket.emit (events.js:314:20)
at Socket.EventEmitter.emit (domain.js:483:12)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)

```

I have also verified the docker container is up and running at that time, as it was accessible through the web browser. I am not sure about the problem that is it a Node client issue or there is something wrong with docker networking? Also right after restarting the docker container, everything started working

---

<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:** [February 13, 2022, 10:01am UTC](https://discuss.elastic.co/t/elasticsearch-with-node-js-throwing-an-error-connect-eaddrnotavail/294495/2 "2022-02-13T10:01:50Z")

</div>

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