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.

ECONNREFUSED crash since version 2.6.1

See original GitHub issue
  • Version: 2.6.1
  • Platform: Node.js v4.2.6 on OS X 10.11.5
  • Description: Description of your issue, stack traces from errors and code that reproduces the issue

The default retry strategy:

var client = redis.createClient({
    retry_strategy: function (options) {
        if (options.error.code === 'ECONNREFUSED') {
            // End reconnecting on a specific error and flush all commands with a individual error
            return new Error('The server refused the connection');
        }
...
        // reconnect after
        return Math.max(options.attempt * 100, 3000);
    }
});

Crashes since version 2.6.1

if (options.error.code === 'ECONNREFUSED')
                 ^
TypeError: Cannot read property 'code' of null

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Mattijahcommented, Jul 10, 2016

I am having the same problem as @elstonie. The options object doesn’t contain any error if connection to Redis was lost. That happens however only when trying to reconnect for the first time, following calls of retry_strategy provide an error.

1reaction
neslinesli93commented, Jun 9, 2016

@BridgeAR thank you, I solved the problem. What I didn’t know is that in order to make this work, I have to listen to error event, or I get unhandled exceptions all over the place

Read more comments on GitHub >

github_iconTop Results From Across the Web

ECONNREFUSED crash since version 2.6.1 #1080 - GitHub
I'm testing what happens to my server when the cache layer(redis) crashes or there is some sort of outage that prevents redis from...
Read more >
Error: connect ECONNREFUSED 127.0.0.1:389 Apollo-React ...
The service starts success, but when I send the first request the service crashed. I'm using this versions: npm v5.6.0; node v8.9.4 ...
Read more >
Bug listing with status RESOLVED with resolution NEEDINFO ...
... "gentoo-sources kernel crash nvidia" status:RESOLVED resolution:NEEDINFO ... Bug:195897 - "after mi glibc 2.6.1 upgrade from 2.5.x there are some ...
Read more >
ECONNREFUSED on runtime - Drivers & ODMs - MongoDB
Hi all, I am running a web app which daily is receiving lots of data and hence manipulating them and storing them into...
Read more >
LineRate Release Notes, version 2.6.1 - AskF5 - F5 Networks
The bug is triggered because a single source IP address can have at most 65535 connections open to a single destination IP address....
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