question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to revive connection: http://localhost:9200/

See original GitHub issue

I am using v0.10.25 still getting this .It was working fine 2 days ago .

Elasticsearch ERROR: 2014-03-19T08:05:18Z
  Error: Request error, retrying -- connect ECONNREFUSED
      at Log.error (/home/ajay/node_modules/elasticsearch/src/lib/log.js:213:60)
      at checkRespForFailure (/home/ajay/node_modules/elasticsearch/src/lib/transport.js:185:18)
      at HttpConnector.<anonymous> (/home/ajay/node_modules/elasticsearch/src/lib/connectors/http.js:150:7)
      at ClientRequest.bound (/home/ajay/node_modules/elasticsearch/node_modules/lodash-node/modern/internals/baseBind.js:56:17)
      at ClientRequest.EventEmitter.emit (events.js:95:17)
      at Socket.socketErrorListener (http.js:1547:9)
      at Socket.EventEmitter.emit (events.js:95:17)
      at net.js:441:14
      at process._tickCallback (node.js:415:13)

Elasticsearch WARNING: 2014-03-19T08:05:18Z
  Unable to revive connection: http://127.0.0.1:9200/

Elasticsearch WARNING: 2014-03-19T08:05:18Z
  No living connections

{ message: 'No Living connections' }
elasticsearch cluster is down!

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:21 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
majiddadashicommented, Jun 8, 2016

On OSX with ElasticSearch server running in a docker container, I was getting the ECONNREFUSED error. I had mapped 9200 of the container to 9200 of the localhost and was trying to get to ElasticSearch through localhost:9200.

Just had to change the elastic search’s ip in my JS code directly to docker-machine’s ip which you can get using echo $(docker-machine ip) and it started working. Strange, but might solve someone’s problem if just wanna get it to work.

I’m using "elasticsearch": "11.0.1"

1reaction
spalgercommented, Jul 11, 2014

I wouldn’t suggest putting the master version of elasticsearch.js in your package.json. Master is regularly broken and should not be relied on.

As far as using nock with elasticsearch.js, I would suggest mocking out elasticsearch at a higher level. By using nock, you are testing all of the client code, which is unnecessary and error prone.

When I’m using elasticsearch.js in a project, I usually mock it out in my tests like this:

var client = require('../../elasticsearch-client');
var stub = require('sinon').stub;

describe('Some Module that uses elasticsearch', function () {
  beforeEach(function () {
    // stub the search method to return generic results
    stub(client, 'search', function (params, cb) {
      process.nextTick(function () {
        cb(null, {
          hits: { total: 121, hits: [ /* ... fake results ... */ ] }
        });
      });
    });
  });

  afterEach(function () {
    client.search.restore();
  });
});

Docs for sinon stubs can be found here

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to revive connection: http://localhost:9200 - Kibana
Hello, Can anyone help me in this?? Currently i have configured ES cluster. After that when i was trying to start kibana, it...
Read more >
How to resolve the error "No living connection" while starting ...
I am using a docker-compose.yml file to run elasticsearch and kibana on localhost. port 9200 is being used by another service so, ...
Read more >
error 11 29 09 846 warning stats-collection Error No Living ...
Hi Guys, I am trying to run the Kibana server, but It is showing the below error. error [11:29 ... /next_tick.js:61:11) How can...
Read more >
Kibana is not ready yet : r/elasticsearch - Reddit
... to revive connection: https://localhost:9200/". Am I missing something that it can't reach the connection? I gave it the correct .pem.
Read more >
LaraDock/laradock - Gitter
... ","admin"],"pid":6,"message":"Unable to revive connection: http://elasticsearch:9200/"} ... How to use Nuxt (http://localhost:3000) with laradock?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found