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.

Cannot read property 'resurrectTimeout' of undefined

See original GitHub issue

Greetings!

I found an error in the code:

https://github.com/elastic/elasticsearch-js/blob/1b638d69925d64a7402617265e739dc85b316ca1/lib/pool/ConnectionPool.js#L107

    const connection = this.connections.find(c => c.id === this.dead[0])

    if ((opts.now || Date.now()) < connection.resurrectTimeout) {
      debug('Nothing to resurrect')
      callback(null, null)
      return
    }

If the connection is not found. Then the code will throw an error further: Cannot read property ‘resurrectTimeout’ of undefined

I just got a lot of such errors in production.

Screen Shot 2020-03-22 at 8 57 21 AM

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
delvedorcommented, Mar 26, 2020

I’ve released this fix in v7.7.0-rc.1, you can install it with

 npm install @elastic/elasticsearch@next
1reaction
kulakowkacommented, Mar 22, 2020

Thank you very much for your help!

I add CustomConnectionPool to my application. And I collect logs. I’ll be back as soon as this happens again.

It should not, that error just means that all the connections registered in the client are marked as dead.

Yes. Restarting the application helps. Errors stop for a while.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property 'Client' of undefined
After working with the debugger as @SteveR suggested, I finally found a hint that led me to elastiseach.js and the following:
Read more >
TypeError: Cannot read property 'timed_out' of null and ...
Hi guys, We are using kibana, search guard in combination with keycloak (openid). While reading indeces in the kibana dashboards I have ...
Read more >
Release notes | Elasticsearch JavaScript Client [7.17] | Elastic
Fixed "Cannot read property then of null" #1594edit ... Show the body as string if the response error can't be read as ES...
Read more >
Cannot read properties of undefined' - JavaScript Debugging
Join Discord https://selftaught-dev.com/join-discord//r/SelfTaughtDev - https://www.reddit.com/r/selftaughtdevGet My Resume Template Free ...
Read more >
Community addon's - Warmane | Forum
IF YOU KNOW WHAT YOU ARE DOING, THAN YOU CAN SCROLL DOWN FOR THE ADDONS PROVIDED, IF NOT, THAN PLEASE READ THE POST...
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