Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis error ClusterAllFailedError: Failed to refresh slots cache #527

Open
gmussi opened this issue Jun 14, 2023 · 7 comments
Open

Redis error ClusterAllFailedError: Failed to refresh slots cache #527

gmussi opened this issue Jun 14, 2023 · 7 comments

Comments

@gmussi
Copy link

gmussi commented Jun 14, 2023

I am facing an issue with the following docker-compose.yml:

  rediscmd:
    image: ghcr.io/joeferner/redis-commander:latest
    restart: unless-stopped
    environment:
      REDIS_HOST: REDACTED.memorydb.eu-central-1.amazonaws.com
      REDIS_PORT: 6379
      REDIS_TLS: true
      REDIS_USERNAME: REDACTED
      REDIS_PASSWORD: REDACTED

It used to work fine before, but after pulling the latest image I am getting:

setUpConnection (C:REDACTED.memorydb.eu-central-1.amazonaws.com:6379:0) Redis error ClusterAllFailedError: Failed to refresh slots cache.
    at tryNode (/redis-commander/node_modules/ioredis/built/cluster/index.js:308:31)
    at /redis-commander/node_modules/ioredis/built/cluster/index.js:325:21
    at Timeout.<anonymous> (/redis-commander/node_modules/ioredis/built/cluster/index.js:662:24)
    at Timeout.run (/redis-commander/node_modules/ioredis/built/utils/index.js:117:22)
    at listOnTimeout (node:internal/timers:571:11)
    at process.processTimers (node:internal/timers:512:7)

Without any changes in infrastructure or configuration.

EDIT: this problem is not present in the previous version (0.8.1)

@sseide
Copy link
Collaborator

sseide commented Jun 14, 2023

with latest image RedisCluster support was added. After connection to the Redis server it checks its properties to figure out if we are dealing with a cluster setup -> if yes it reconnects with IORedis Cluster client now.

Its an AWS Memorydb or ElastiCache?

Older image used plain Redis client instead on every connection.

@sseide
Copy link
Collaborator

sseide commented Jun 14, 2023

And is it possible to start Redis Commander with the DEBUG=ioredis:* env var set? Maybe the real error was hidden by the "ClusterAllFailedError".

sseide added a commit to sseide/redis-commander that referenced this issue Jun 28, 2023
@sseide
Copy link
Collaborator

sseide commented Jun 28, 2023

@gmussi i was able to repoduce this error and pushed a fix to latest. Can you please test if it helps you too?

sseide added a commit to sseide/redis-commander that referenced this issue Jul 3, 2023
@sseide
Copy link
Collaborator

sseide commented Jul 3, 2023

@gmussi added some more code to handle more variants. Any feedback if it is working for you now?

@grantkl
Copy link

grantkl commented Jul 28, 2023

Can you add CLUSTER_NO_TLS_VALIDATION as a supported ENV variable? I don't see it in https://github.com/joeferner/redis-commander/blob/master/docker/entrypoint.sh

@grantkl
Copy link

grantkl commented Jul 28, 2023

After manually configuring the json configuration to:

{
      "label": "local",
      "dbIndex": 0,
      "username": null,
      "password": "",
      "connectionName": "redis",
      "optional": false,
      "clusterNoTlsValidation": true,
      "host": "localhost",
      "port": 6379,
      "isCluster": true,
      "sentinelUsername": null,
      "sentinelPassword": "",
      "clusters": [
        {
          "host": "clustercfg.redis.nwuplk.usw2.cache.amazonaws.com",
          "port": 6379
        }
      ]
    }

I still get

node ./bin/redis-commander
Using scan instead of keys
No Save: false
listening on 0.0.0.0:8081
access with browser at http://127.0.0.1:8081
setUpConnection (C:clustercfg.redis.nwuplk.usw2.cache.amazonaws.com:6379:0) Redis error ClusterAllFailedError: Failed to refresh slots cache.
    at tryNode (/redis-commander/node_modules/ioredis/built/cluster/index.js:308:31)
    at /redis-commander/node_modules/ioredis/built/cluster/index.js:325:21
    at Timeout.<anonymous> (/redis-commander/node_modules/ioredis/built/cluster/index.js:662:24)
    at Timeout.run (/redis-commander/node_modules/ioredis/built/utils/index.js:117:22)
    at listOnTimeout (node:internal/timers:571:11)
    at process.processTimers (node:internal/timers:512:7)

@aamotharald
Copy link
Contributor

Hi @grantkl ,
at least with running on node directly I was able to connect to a clustered redis instance in AWS and visualize it.

redis-commander  \
  --cluster-no-tls-validation\
  --is-cluster \
  --redis-tls \
  --redis-host <some-aws-cluster-host> \
  --redis-port <some-aws-cluster-port> \
  --redis-password <a-very-secret-password>

So I would expect that to also work in docker with having the CLUSTER_NO_TLS_VALIDATION for docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants