-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Read ECONNRESET every 3 mins - NodeJS server crashes due to this. Using newrelic plugin for server monitoring. #713
Comments
To me, this sounds like a networking issue outside Node.js, this error "ECONNRESET" is when the remote connection to Node.js closes the socket unexpectedly. Are you using a proxy between Node and Redis? What version of Node/node_redis/Redis server? I doubt the NewRelic agent is involved, but you could always try to reproduce without the agent and see if that fixes the issue. cc/ @wraithan |
Those lines are just CLS doing it's thing. With more of a repro I could fully rule out the New Relic agent. But I'm relatively confident this isn't being caused by us. |
I removed the NewRelic agent, the problem still occurs. Approx. every 3 mins I get this crash happening. Below are the logs for reference. events.js:72 Also, I'm using Node.JS - v0.10.35, node_redis - 0.12.1 & Redis - 2.8.4. |
I was facing this problem too, but just got resolved after I realized I was playing around with my
@ayazpasha2434 the solution might not be the same for you, but like others are hinting, it is defintely outside node and in the env/shell/OS/VM. Step back a little and stare at it. |
@sarathms I have this mapping in my hosts file. However, the Redis machine in my case is a remote one. Just cross-checked, I have the said localhost mapping in Redis machine as well. Still the problem is not solved. |
I am also facing the same problem . Here is the Console Output events.js:72 |
@ayazpasha2434 This line solved my error client.on('error',function(err){ console.error(err)}) |
@ayazpasha2434 Did @Waterloo have the right answer for you? |
There seemed to be an issue with your network connection and it does not seem to be an issue with node redis. Adding the error handler should be sufficient so the app does not crash anymore (and it should always be attached). |
I met this problem when I post a http(use post) to JAVA server.{ [Error: read ECONNRESET] |
@biggu0 I'm not sure what connection this has to node_redis. To find out more about ECONNRESET you might want to look at stackoverflow. |
Hi There , below are the snapshotting setting in redis.conf Please let us know if we are doing something wrong. |
I am also facing connection issue frequently . ERR at RedisClient.emit (events.js:188:7) After getting the error it is automatically reconnecting. |
Hi Waterloo , Thanks in advance!!! |
Hello I am also facing the same issue events.js:160 Error: read ECONNRESET |
This solved my problem with:
process.on('uncaughtException', function (err) {
console.error(err.stack);
console.log("Node NOT Exiting...");
}); |
I ma also facing this issue. I am using with sails.js framework with a hook, so there is only one connection to redis server when starting node service, we will use global sails object to access and work with redis redisClient = redis.createClient({
host: redisConfig.host,
port: redisConfig.port,
db: redisConfig.db,
retry_strategy: (retryOptions) => {
if (retryOptions.error && retryOptions.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');
}
if (retryOptions.total_retry_time > 1000 * 60 * 60) {
// End reconnecting after a specific timeout and flush all commands
// with a individual error
return new Error('Retry time exhausted');
}
if (retryOptions.attempt > 3) {
// End reconnecting with built in error
return undefined;
}
sails.log.debug('Handling redis retry strategy', {
error: retryOptions.error,
totalRetryTime: retryOptions.total_retry_time,
attempt: retryOptions.attempt
});
// Reconnect after
return Math.min(retryOptions.attempt * 100, 3000);
}
}); Here is the stack trace of the error Our node app is running on a Docker container and it will connect to Redis server installed on an EC2 linux instance. |
We also facing same issue, but here we placed the stunnel to proxy the redis to localhost using below stunnel configuration. fips = no [redis-cli] node is disconnecting with these below errors for every couple of minutes. We running these through docker containers. Redis connection to 127.0.0.1:6379 failed - read ECONNRESET any resolution ? |
same to me i think this is an issue with stunnel |
I am also facing same error
I am also using error handler but the thing is why is this happening, it can impact my query calls and delay my requests. @ayaz Can you please open this issue because this issue is not completely resolved people only have handled error response but the problem is still unresolved. |
Bumping: Same issue here:
|
I see the same in issue with:
Redis is provided by using Google Cloud MemoryStore. The logs shows: [ioredis] Unhandled error event: Error: read ECONNRESET This is happening around one time each 24 hours without any specific reason or same steps, it just happen |
@robertop87 |
Also seeing very similar issue with Cloud run / Cloud Functions when connecting to Cloud Memory Store. It possibly could be happening when the underlying resources are stopped too soon randomly by Google. This issue just started about a week ago for us, with no changes to how we are handling the Redis connection. We are also using ioredis to handle the connection and running node 12. |
IORedis has as default strategy reconnect on error, but some reason it's not happening. What I did is add the next in configuration:
The ECONNRESET error is still present, but now my connection is retried and my Google Instance is not being stuck anymore. CC: @hkd987 Read more details about |
@robertop87 Made a new deployment with the specific configuration to always |
Error: Redis connection to redis1.tfs.tfs:6379 failed - read ECONNRESET at RedisClient.on_error (/var/www/a/b/c/node_modules/redis/index.js:196:24) at Socket. (/var/www/a/b/c/node_modules/redis/index.js:106:14)
at Socket.emit (events.js:95:17)
at net.js:441:14
at /var/www/a/b/c/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:188:31
at /var/www/a/b/c/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:188:31
at process._tickDomainCallback (node.js:486:13)
at process. (/var/www/a/b/c/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/index.js:18:15)
The text was updated successfully, but these errors were encountered: