redis / ioredis

🚀 A robust, performance-focused, and full-featured Redis client for Node.js.
MIT License
14.27k stars 1.19k forks source link

[ioredis] Unhandled error event: ClusterAllFailedError: Failed to refresh slots cache with AWS ElastiCache without +info +cluster access string #1902

Open shaileshkathole23 opened 2 months ago

shaileshkathole23 commented 2 months ago

I am using IORedis to connect to AWS ElastiCache with:

  1. clustered enabled with 1 shard, 2 replicas
  2. at rest/in transit encryption enabled
  3. Access control: user group access control list
  4. Using new user with password and access string: on ~* +@all -@dangerous -@admin

With code

new IORedis.Cluster(
        [
            {
                host: "redis_cluster_configuration_endpoint",
                port: 6379,
            },
        ],
        {
            dnsLookup: (address: any, callback: any) => callback(null, address),
            redisOptions: {
                username: "username",
                password: "*****",
                tls: {
                    checkServerIdentity: (servername: any, cert: any) => undefined,
                },
            },
        }
    );

IOredis throws error: [ioredis] Unhandled error event: ClusterAllFailedError: Failed to refresh slots cache

When I update the user access string to on ~* +@all -@dangerous -@admin +info +cluster it works fine.

Is their any documentation why ioredis requires additional +info +cluster access string which is marked as dangerous category?

Is it mandatory to have +info +cluster access string? If yes, why and if you can share documentation to understand it?

Toritos01 commented 2 months ago

Hi @shaileshkathole23, I'm not sure about the documentation, I think the project is not being maintained much nowadays. Wondering though, what part did you add this access string in? I've been facing some similar issues. Thanks!

Edit: Ahh actually it looks like the access strings are specific to ElastiCache, I'm using Azure Redis Cache :)