Error: connect ETIMEDOUT ----use bluebird
See original GitHub issueI use bluebird replace native promise, error happened!
ioredis:redis status[172.31.15.99:5818]: [empty] -> connecting +0ms
ioredis:redis queue command[172.31.15.99:5818]: 2 -> set([ 'aaa', '1' ]) +5ms
ioredis:connection error: Error: connect ETIMEDOUT +0ms
redisClient connect to db error: { Error: connect ETIMEDOUT
at Socket.<anonymous> (/opt/project/umichat/umichat_manage/node_modules/_ioredis@4.14.1@ioredis/built/redis/index.js:282:31)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at Socket.emit (events.js:208:7)
at Socket._onTimeout (net.js:422:8)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5) errorno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect' }
ioredis:redis status[172.31.15.99:5818]: connecting -> close +10s
ioredis:connection reconnect in 50ms +3ms
ioredis:redis status[172.31.15.99:5818]: close -> reconnecting +1ms
ioredis:redis status[172.31.15.99:5818]: reconnecting -> connecting +50ms
envriment:
node: v8.16.0
redis server: 5.0.5
ioredis: 4.14.1
bluebird: 3.5.5
my test code
const bluebird = require('bluebird');
global.Promise = bluebird;
const Redis = require('ioredis');
const instance = new Redis({
port: 6379,
host: 'localhost',
db: 2,
});
instance.on('error', e => {
console.error(`redisClient connect to db error:`, e);
});
instance.set("aaa", 1)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:19 (7 by maintainers)
Top Results From Across the Web
Error: connect ETIMEDOUT ----use bluebird - Bountysource
I use bluebird replace native promise, error happened! ioredis:redis status[172.31.15.99:5818]: [empty] -> connecting +0ms ioredis:redis ...
Read more >Error: connect ETIMEDOUT when scraping - node.js
Well ETIMEDOUT means something couldn't keep up with the pace you were throwing at it. You will have to slow down the number...
Read more >Unexpected error timeout, after running serverless
I have some issues with serverless & sequelize. After I'm running serverless offline on my local computer, I always get error like below....
Read more >trouble with npm dependencies, doesn't seem to use Nexus ...
trouble with npm dependencies, doesn't seem to use Nexus for deps. 756 views ... npm WARN retry will retry, error on last attempt:...
Read more >[Solved]-Error: connect ETIMEDOUT when scraping-mongodb
As discussed in comments, if you want to control the max number of requests that are in-flight at the same time, you can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@alavers I’d think we can check if
stream
has already connected before attaching the listener to connect event (https://github.com/luin/ioredis/blob/master/lib/redis/index.ts#L307) so can be:Not sure if Node.js provides enough APIs for the
isConnected
method.you can tell whether a function wants a callback by the length of that function, no need to break the promise contract now