Ioredis: sentinel connect unhandled error

Created on 31 May 2018  路  5Comments  路  Source: luin/ioredis

Unhandled error event: Error: All sentinels are unreachable. Retrying from scratch after 10ms.

but I can reach all sentinels server,and all redis operator is ok.

so, I dont understand why this error shown frequently.

wish solutions, sincerely.

bug wontfix

Most helpful comment

I鈥榤 get the same problem, but the detail error message is
Unhandled error event: Error: connect ETIMEDOUT
at Socket. (/node_modules/ioredis/lib/redis.js:289:21)
Also, I can access all sentinel servers by redis-cli.

All 5 comments

I鈥榤 get the same problem, but the detail error message is
Unhandled error event: Error: connect ETIMEDOUT
at Socket. (/node_modules/ioredis/lib/redis.js:289:21)
Also, I can access all sentinel servers by redis-cli.

Sorry for the late response. Could you enable the debug log (DEBUG=ioredis:* node yourapp.js) and post the logs here?

ioredis:redis status[10.27.18.227:26379]: ready -> close +1ms
  ioredis:connection skip reconnecting since the connection is manually closed. +1ms
  ioredis:redis status[10.27.18.227:26379]: close -> end +0ms
  ioredis:redis status[10.37.65.92:6379]: connect -> ready +0ms
  ioredis:redis status[10.37.65.92:6379]: ready -> close +4s
  ioredis:connection reconnect in 50ms +6ms
  ioredis:redis status[10.37.65.92:6379]: close -> reconnecting +1ms
  ioredis:redis status[10.37.65.92:6379]: reconnecting -> connecting +52ms
  ioredis:SentinelConnector All sentinels are unreachable. Retrying from scratch after 10ms +0ms
[2018-07-02 09:02:14.104] [ERROR] console - [ioredis] Unhandled error event: Error: All sentinels are unreachable. Retrying from scratch after 10ms
    at connectToNext (E:\*\node_modules\ioredis\lib\connectors\sentinel_connector.js:64:19)
    at SentinelConnector.connect (E:\*\node_modules\ioredis\lib\connectors\sentinel_connector.js:44:3)
    at Redis.<anonymous> (E:\*\node_modules\ioredis\lib\redis.js:264:20)
    at Promise._execute (E:\*\node_modules\bluebird\js\release\debuggability.js:300:9)
    at Promise._resolveFromExecutor (E:\*\node_modules\bluebird\js\release\promise.js:483:18)
    at new Promise (E:\*\node_modules\bluebird\js\release\promise.js:79:10)
    at Redis.connect (E:*\node_modules\ioredis\lib\redis.js:250:10)
    at Timeout._onTimeout (E:\*\node_modules\ioredis\lib\redis\event_handler.js:95:12)
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)
  ioredis:redis status[10.27.18.228:26379]: [empty] -> connecting +12ms
  ioredis:redis queue command[0] -> sentinel(get-master-addr-by-name,d_c10943_1) +3ms
  ioredis:redis status[10.27.18.228:26379]: connecting -> connect +1ms
  ioredis:redis status[10.27.18.228:26379]: connect -> ready +0ms
  ioredis:connection send 1 commands in offline queue +0ms
  ioredis:redis write command[0] -> sentinel(get-master-addr-by-name,d_c10943_1) +1ms
  ioredis:redis write command[0] -> sentinel(sentinels,d_c10943_1) +1ms
  ioredis:SentinelConnector sentinels [ { host: '10.27.18.228', port: 26379 },
  { host: '10.27.18.227', port: 26379 },
  { host: '10.27.18.225', port: 26379 } ] +1ms
  ioredis:SentinelConnector resolved: 10.37.65.92:6379 +0ms
  ioredis:redis status[10.37.65.92:6379]: connecting -> connect +1ms
  ioredis:redis write command[0] -> info() +1ms
  ioredis:redis status[10.27.18.228:26379]: ready -> close +0ms
  ioredis:connection skip reconnecting since the connection is manually closed. +0ms
  ioredis:redis status[10.27.18.228:26379]: close -> end +1ms
  ioredis:redis status[10.37.65.92:6379]: connect -> ready +0ms

thanks for the response.Above is the debug log, it seems like network error, but I can reach all sentinel ip
in fact.

@luckyscript This is a bug in ioredis and will be fixed in the next release (v4.0.0-2). Currently you can ignore this issue safely.

This issue happens when resolved a master address successfully use the last sentinel in the provided sentinel list. When a reconnection happens, ioredis will connect to the next sentinel, which is the end of the list, thus a "Unreachable" error is emitted.

Thank you for pointing this out!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 7 days if no further activity occurs, but feel free to re-open a closed issue if needed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eduleboss picture eduleboss  路  3Comments

haoxins picture haoxins  路  5Comments

hzxuzhonghu picture hzxuzhonghu  路  5Comments

dfee picture dfee  路  4Comments

AdriVanHoudt picture AdriVanHoudt  路  4Comments