Open danielbush opened 7 months ago
Hey guys, is there a workaround for this? I also faced that while trying to make redis work with ElastiCache Serverless
We also get a similar problem sometimes when using cluster mode against elasticache 7.1
TypeError: Cannot read properties of undefined (reading 'master')
at RedisClusterSlots.getClient (/usr/src/app/node_modules/@redis/client/dist/lib/cluster/cluster-slots.js:108:59)
at Commander._RedisCluster_execute (/usr/src/app/node_modules/@redis/client/dist/lib/cluster/index.js:217:79)
at Commander.sendCommand (/usr/src/app/node_modules/@redis/client/dist/lib/cluster/index.js:129:98)
at Commander.commandsExecutor (/usr/src/app/node_modules/@redis/client/dist/lib/cluster/index.js:126:75)
Happens when we do many set commands in parallel.
We are facing a similar issue, also pointing to a serverless elasticache 7.1.
Is it something that we can fix/help on our end?
I tried redis 4.7 - I think it includes https://github.com/redis/node-redis/pull/2731 - but I'm still getting the original issue.
If anyone is seeing the contrary, let me know.
rejectUnauthorized: false
might be helpful
redisClient = redis.createCluster({
rootNodes: [{ url: config.url }],
defaults: {
socket: {
tls: true,
rejectUnauthorized: false
},
},
});
Description
Environment:
We're getting this error - I think it's intermittent ie it works maybe even a lot of the time:
Stacktrace (redactions using
xxx
):You can see HttpClient (an internal library being asked to make a request. It then calls
cacheItem
(an internal module) which then callsredis.get
as per code below to check if there's something in the cache usingget
before making the http request.Code:
We get the client like this (within an async function). It is long-running, we keep using the same instance once created. Note we pass only one url to
rootNodes
- the cluster configuration endpoint provided by AWS Elasticache. (I wonder if that is an issue as the docs say to pass several nodes, I struggled to find docs on this).Error is triggered in code like this using the above
redisClient
:Node.js Version
18.19.1
Redis Server Version
6.2.6
Node Redis Version
4.6.13
Platform
Linux
Logs
No response