Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection Issues #46

Closed
blackjk3 opened this issue Feb 14, 2014 · 1 comment
Closed

Connection Issues #46

blackjk3 opened this issue Feb 14, 2014 · 1 comment

Comments

@blackjk3
Copy link

I get the error below when trying to make a simple request to my es index. The elasticsearch-js library works perfect on my localhost but once I push it to a ubuntu server I get the error below.

Elasticsearch ERROR: 2014-02-14T12:59:47Z
  Error: Request error, retrying -- connect ENOENT
      at Log.error (/var/www/omgtransitapp/releases/20140214125838/api/node_modules/elasticsearch/src/lib/log.js:213:60)
      at checkRespForFailure (/var/www/omgtransitapp/releases/20140214125838/api/node_modules/elasticsearch/src/lib/transport.js:185:18)
      at HttpConnector.<anonymous> (/var/www/omgtransitapp/releases/20140214125838/api/node_modules/elasticsearch/src/lib/connectors/http.js:137:7)
      at ClientRequest.bound (/var/www/omgtransitapp/releases/20140214125838/api/node_modules/elasticsearch/node_modules/lodash-node/modern/internals/baseBind.js:52:17)
      at ClientRequest.EventEmitter.emit (events.js:101:17)
      at Socket.socketErrorListener (_http_client.js:239:9)
      at Socket.EventEmitter.emit (events.js:101:17)
      at net.js:434:14
      at process._tickCallback (node.js:599:11)

Though a lot of trial and error I was able to the client to connect if I commented the agent parameter in the reqParams hash in http.js. Does anyone know if this is a legitimate bug or if I have something configured incorrectly? It looks like agent is derived from another module "ForeverAgent".

var reqParams = {
    method: params.method || 'GET',
    protocol: host.protocol + ':',
    auth: host.auth,
    hostname: host.host,
    port: host.port,
    path: (host.path || '') + (params.path || ''),
    headers: headers,
    //agent: this.agent
  };
@spalger
Copy link
Contributor

spalger commented Feb 14, 2014

It looks like connect ENOENT errors come from sockets when they encounter a DNS lookup error. My hunch is that there was some underlying networking error which may have gone away, or that using disposable sockets is hiding.

Can you verify that re-enabling the agent causes the error to return? While doing that could you also set the logging level to trace and share the output along with your config?

I looked through the ForeverAgent code and confirmed that all it does is handle socket availability. Node's HttpAgent takes care of all the network logic, which is still the case when you remove ForeverAgent from the mix. With that, I'm inclined to think ForeverAgent is not to blame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants