Closed divineforge closed 3 years ago
additional info: "ioredis": "^4.19.2"
Hey @divineforge,
That looks strange especially given only one server had this issue. SentinelIterator#sentinels
should never be reassigned so the only reason I can think of is you passed a non-array value for the sentinels
option, ex a string. Like instead of:
new Redis({
sentinels: 'https://xx'
})
You should use:
new Redis({
sentinels: ['https://xx']
})
Is this your case?
thanks for the heads up. I'll further debug along this line. :)
Actually, I don't seem to find anything yet @luin All the previous Redis connect in the log, shows successfully connected. and also from the console output, the sentinels info are read as array correctly.
the point is doesn't work in that particular server, was the moment when about to call for 'client.subscribe'.. any further clue you could think of? Possiblyy throwing this error? or in any other way, could put some debugging or catch the error from that redis client?
Hmm...I can't think of any. The code is here in case you want to double-check: https://github.com/luin/ioredis/blob/master/lib/connectors/SentinelConnector/SentinelIterator.ts#L33
I don't find any cases in this file that this.sentinels
is reassigned so if its initial value is an array, it should always be an array.
hi @luin , thanks actually I found it's caused by the mis-configuration in the redis-sentinel. at such the redis-sentinel service in RHEL is forcing the Redis-server as slave of its own instance, instead of connecting to the actual master node.
thanks for attending to this.
hi I have an odd issue happening in one of my application servers. (only 1) the others are behaving correctly. I checked to ensure the redis and redis-sentinel are working correctly sentinels information are passed correctly. No errors are thrown during making Redis client connection.
Hence looking for a clue what could go wrong? attaching a screenshot below.