# NodeJS client not respecting URL option

**URL:** <https://discuss.elastic.co/t/nodejs-client-not-respecting-url-option/222387>\
**Category:** Elasticsearch\
**Created:** [March 6, 2020, 12:05am UTC](https://discuss.elastic.co/t/nodejs-client-not-respecting-url-option/222387 "2020-03-06T00:05:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbaindourov](https://avatars.discourse-cdn.com/v4/letter/r/bc8723/32.png) [@rbaindourov](https://discuss.elastic.co/u/rbaindourov)\
**Post date:** [March 6, 2020, 12:05am UTC](https://discuss.elastic.co/t/nodejs-client-not-respecting-url-option/222387/1 "2020-03-06T00:05:07Z")

</div>

So I am instantiating the esclient with  
const esclient = new require('elasticsearch').Client({ node: "[http://10.164.204.92:9200/](http://10.164.204.92:9200/)" , sniffOnStart: false });

But when it decides to run, it's totally ignoring the setting and trying to access localhost.  
I don't want that functionality. Why can't I connect to a remote node?  
What is going on here?

Elasticsearch ERROR: 2020-03-05T23:53:56Z  
Error: Request error, retrying  
POST [http://localhost:9200/epics/\_doc/recrgdRN73MleqAAN](http://localhost:9200/epics/_doc/recrgdRN73MleqAAN) =\> connect ECONNREFUSED 127.0.0.1:9200  
at Log.error (/Users/c-robert.baindourov/etl-jira-airtable/packages/elastic-loader/node\_modules/elasticsearch/src/lib/log.js:239:56)  
at checkRespForFailure (/Users/c-robert.baindourov/etl-jira-airtable/packages/elastic-loader/node\_modules/elasticsearch/src/lib/transport.js:298:18)  
at HttpConnector. (/Users/c-robert.baindourov/etl-jira-airtable/packages/elastic-loader/node\_modules/elasticsearch/src/lib/connectors/http.js:171:7)  
at ClientRequest.wrapper (/Users/c-robert.baindourov/etl-jira-airtable/packages/elastic-loader/node\_modules/lodash/lodash.js:4929:19)  
at ClientRequest.emit (events.js:223:5)  
at Socket.socketErrorListener (\_http\_client.js:406:9)  
at Socket.emit (events.js:223:5)  
at emitErrorNT (internal/streams/destroy.js:92:8)  
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)  
at processTicksAndRejections (internal/process/task\_queues.js:81:21)

Elasticsearch WARNING: 2020-03-05T23:53:56Z  
Unable to revive connection: [http://localhost:9200/](http://localhost:9200/)

Elasticsearch WARNING: 2020-03-05T23:53:56Z  
No living connections

(node:75996) UnhandledPromiseRejectionWarning: Error: No Living connections  
at sendReqWithConnection (/Users/c-robert.baindourov/etl-jira-airtable/packages/elastic-loader/node\_modules/elasticsearch/src/lib/transport.js:266:15)  
at next (/Users/c-robert.baindourov/etl-jira-airtable/packages/elastic-loader/node\_modules/elasticsearch/src/lib/connection\_pool.js:243:7)  
at processTicksAndRejections (internal/process/task\_queues.js:76:11)  
(node:75996) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)  
(node:75996) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

---

<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 3, 2020, 12:05am UTC](https://discuss.elastic.co/t/nodejs-client-not-respecting-url-option/222387/2 "2020-04-03T00:05:17Z")

</div>

Closed on April 3, 2020, 12:05am UTC

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