Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Sep 23 04:09
    laverdet commented #1259
  • Sep 23 03:20
    laverdet commented #1259
  • Sep 23 03:19
    laverdet commented #1259
  • Sep 22 04:40
    fiwz opened #1658
  • Sep 21 20:54
    hheshamazon commented #1657
  • Sep 21 20:53
    hheshamazon edited #1657
  • Sep 21 20:52
    hheshamazon opened #1657
  • Sep 21 06:39
    sandeep-svg opened #1656
  • Sep 21 01:28
    kidus60 commented #1003
  • Sep 20 08:36
    ZLY201 commented #1649
  • Sep 20 08:36
    ZLY201 commented #1649
  • Sep 19 19:34
    rvrita commented #1632
  • Sep 19 17:08
    silverwind opened #1655
  • Sep 19 17:00
    silverwind commented #1362
  • Sep 19 16:59
    silverwind commented #1362
  • Sep 19 16:59
    silverwind commented #1362
  • Sep 19 16:58
    silverwind commented #1362
  • Sep 19 16:13
    jayantasamaddar commented #1638
  • Sep 19 16:13
    jayantasamaddar commented #1638
  • Sep 19 13:46
    isaadabbasi commented #1419
anyone active?
Sourav Ray

I am facing issue in connecting to a single Elasticsearch instance. My code looks like bellow -

this.instance = new Redis({
      host: REDIS_HOST,
      port: REDIS_PORT,
      tls: {},
      connectTimeout: 10000,
      maxRetriesPerRequest: 4,
      retryStrategy: (times) => Math.min(times * 30, 1000),
      reconnectOnError: (error) => {
        const targetErrors = [/READONLY/, /ETIMEDOUT/];
        targetErrors.forEach((targetError) => {
          if (targetError.test(error.message)) {
            return true;
   RedisConnection.instance = this.instance;

I am getting following errors -

    errno: 'ECONNREFUSED',
    code: 'ECONNREFUSED',
   syscall: 'connect',
   address: '',
   port: 6379

I have verified that host: REDIS_HOST has correct resource address and it is not passing or localhost.

Sourav Ray
Got the issue resolved. I think the community is not much active here.
Trung Tin Luong
hi guys !
import Redis from 'ioredis';
readonly redis = new Redis(+DB_REDISPORT, DB_REDISHOST, { password: DB_REDISPASS });
Im using, but have error: [ioredis] Unhandled error event: ReplyError: NOAUTH Authentication required.
plese help me for guide wrong
Advaith Doosa
Hey all, was wondering if anyone has encountered issues with .scanStream({match: "*pattern"})
1 reply
I keep getting empty arrays while watching the stream for data
Jonathan Yen
hi, would anyone know what's going on with this:
@400000005f6a655f02387564 [ioredis] Unhandled error event: ClusterAllFailedError: Failed to refresh slots cache.
@400000005f6a655f02387d34     at tryNode (/var/www/api4/node_modules/ioredis/built/cluster/index.js:359:31)
@400000005f6a655f0238811c     at /var/www/api4/node_modules/ioredis/built/cluster/index.js:376:21
@400000005f6a655f02388504     at Timeout.duplicatedConnection.cluster.utils_2.timeout (/var/www/api4/node_modules/ioredis/built/cluster/index.js:624:24)
@400000005f6a655f023888ec     at Timeout.run (/var/www/api4/node_modules/ioredis/built/utils/index.js:156:22)
@400000005f6a655f0238dedc     at listOnTimeout (timers.js:326:17)
@400000005f6a655f0238e2c4     at processTimers (timers.js:268:5)
#1248 Does anyone meet this issue?
We got the error of All keys in the pipeline should belong to the same slots allocation group when enableAutoPipelining set true
Shashi Saini
Hi I use ioredis scanstream functionality in my AWS lambda. It seems my lambda never terminates successfully whenever it connects to Redis. I see timed out messages in AWS cloudwatch logs for the lambda. My lambda function is a kinesis consumer so just keeps getting same payload again and again since the lambda doesn't compeletes successfully. Does anybody saw similar issue? Is there a way to gracefully terminate redis connections from lambdas?
Hi guys. I am new to elastic cache and have some issues connecting to elastic cache cluster
Getting this issue:Unhandled error event: ClusterAllFailedError: Failed to refresh slots cache. My setup looks like new Cache([{ host: clustercfg.xxxx.xxxx.xxxx.cache.amazonaws.com}], { redisOptions: { password: bananas, tls: {}} ) What am I doint wrong
Can you delete a key via ioredis?
Jonathan Hrang
I'm getting this error, when I try to connect locally so can anybody help with Zoom pls?. I'll pay you. thanks
Jonathan Hrang
if someone saw this and think can help me pls let me know at jsianguk@gmail.com thanks
@luin Hi, I added RedisWritable and RedisReadable to ioredis. luin/ioredis#1376
@spiderunderurbed:matrix.org yes, by doing a redis.del or better redis.unlink
Richard Castera
Hello, where is there documentation for using ioredis with TLS and Sentinel?
Kasun Vithanage
Hi, why i get ETIMEDOUT when TLS option enabled? im using heroku
Hi, I am trying to connect redis cluster using a node.js application .. however, i am getting this error "ioredis unhandled error event clusterallfailederror failed to refresh slots cache".. Can anyone help here?
Connection to the single node is working fine
anyone know how to implement a similar detect_buffers property that exists in node_redis library for ioredis?
nvm there is getBuffer API calls
and associated buffer calls
anyone know how to deal with ioredis sockets staying open in tests? I've tried redis.quit() and redis.disconnect() and the socket still stays open
^ i had a hanging socket i didn't close!
Jack C
when i use hmset, nested objects return as '[object Object]', is there any way to fix this?
Hyunji Song
Anyone know why I'm getting this error for my redis cluster Too many Cluster redirections. Last error: ReplyError: MOVED 12182 :0 with 3 nodes
Edgaras Masilionis
Hey guys, I started up 6 redis cluster nodes (3 masters and 3 replicas) and now I'm trying to connect to them but I keep getting ClusterAllFailedError: Failed to refresh slots cache, and it just does not stop, I also tried "workarounds" found by googling (like adding high values for slotsRefreshTImeout and slotsRefreshInterval) but then my cluster is not working, any ideas?
Brandon Max
Hi Friends!
Glad this chat is somewhat alive. I have a command timeout set for a .get. I'm curious how to make that command timeout execute the retryStrategy?
Brandon Max
we're gonna give auto pipelining a good. Godspeed.
Jack Twilley
I am using a transparent key prefix but would like to get some specific keys outside that prefix. Are there alternatives to using KEYS or SCAN in this case?
Jack Twilley
It is a shame that one cannot override transparent key prefixes within specific commands.
Sujith Krishnan
Anyone know the reason behind READONLY You can't write against a read only slave?
I am using AWS ElasticCache cluster endpoint with two nodes.
Abhishek Kumar
wow.. this page existed. good to know..
Abhishek Kumar
Error: All keys in the pipeline should belong to the same slots allocation group
    at Pipeline.exec (/home/ubuntu/loco_projects/yen/node_modules/ioredis/built/pipeline.js:250:29)
    at Pipeline.pipeline.exec (/home/ubuntu/loco_projects/yen/node_modules/ioredis/built/transaction.js:50:34)
    at /home/ubuntu/loco_projects/yen/dist/services/redis/index.js:703:41
    at new Promise (<anonymous>)
    at Function.<anonymous> (/home/ubuntu/loco_projects/yen/dist/services/redis/index.js:702:43)
    at step (/home/ubuntu/loco_projects/yen/dist/services/redis/index.js:52:23)
    at Object.next (/home/ubuntu/loco_projects/yen/dist/services/redis/index.js:33:53)
    at /home/ubuntu/loco_projects/yen/dist/services/redis/index.js:27:71
    at new Promise (<anonymous>)
    at __awaiter (/home/ubuntu/loco_projects/yen/dist/services/redis/index.js:23:12)
    at Function.RedClient.addTabStickerToSet (/home/ubuntu/loco_projects/yen/dist/services/redis/index.js:676:16)
    at Function.<anonymous> (/home/ubuntu/loco_projects/yen/dist/api/components/stickers/dao.js:644:64)
    at step (/home/ubuntu/loco_projects/yen/dist/api/components/stickers/dao.js:63:23)
    at Object.next (/home/ubuntu/loco_projects/yen/dist/api/components/stickers/dao.js:44:53)
    at fulfilled (/home/ubuntu/loco_projects/yen/dist/api/components/stickers/dao.js:35:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Uncaught exception: All keys in the pipeline should belong to the same slots allocation group
Please help.. i m using ioredis version 4.19
Abhishek Kumar
how should i use multi properly..?
Abhishek Kumar
i understand this error was coming coz my project was using multi of redis..
when i changed back it worked.
Hello, I came upon luin/ioredis#870 while debugging an issue I have using a Redis Cluster with NestJS. I see a similar cycling in my debug output and any command to Redis just hangs and never emits ready. It connects then disconnects "because the node does not hold any slot." In single-node mode, it works fine. Manual MEET commands through redis-cli doesn't seem to fix it and I'm able to manually run commands through redis-cli. I created a minimal repro to demonstrate. I'm starting with DEBUG=ioredis:* nest start --watch. The Docker Compose config for the Redis cluster is in the repo. Any help would be appreciated. Thank you.

Hi ! I have an issue connecting to sentinels. I receive a timeOut. I am pretty sure I reach the sentinels because if I change the clusterName I have a different error. So I think, it is more to do with my docker stack. For now, I expose my 3 sentinels on port 5000, 5001 and 5002 but I do not expose my nodes, they all listen to the internal docker network.

Should I expose those ? If yes, how the sentinels would be aware of the docker bridge of the new master node ?

There is something I don't get here
Jack Stepanyan

Hello everyone. I have one question regarding autopipeline. consider this code

const autoPipeline = async () => {
    const redis = new Redis({enableAutoPipelining: true});

    const promises = [];
    for (let i = 0; i < 10000; i++) {
        promises.push(redis.set(`key${i}`, `value${i}`, 'EX', 4));
    await Promise.all(promises)

here enableAutoPipelining is specified explicitly . code execution takes around 81 milliseconds on my machine. now the same code but if i remove enableAutoPipelining from constructor will run for 51-59 milliseconds. i don't really get that part. shouldn't it be faster with enableAutoPipelining ?

Mina Luke

Hello everyone,
I started using ioredis and have couple of questions.

  • Is there a way to get slots (from/to) for each master node
  • Is there a way to get master nodes for each replicate node

Using redis-cli I can get such info just by running cluster nodes, it would give me all slots info and master/replica associations.
In ioredis though, I tried cluster.nodes and cluster.slots but could not find such info