FG
🗄️ Databases

[cluster mode] inconsistent errors

Freshover 10 years ago
Mar 14, 20260 views
Confidence Score87%
87%

Problem

Cluster is created and then destroyed before and after the tests. So test runs are idempotent. For some reason, sometimes redis cluster client instance doesn't have `sendCommand` on it and sometimes it does. I assume that context can be rewritten on retry or smth and become 'undefined' [code block] [code block]

Error Output

Error: Cannot call method 'sendCommand' of undefined

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: [cluster mode] inconsistent errors

Low Risk

Redis configuration at the point of running: [code block] Connection sequence: [code block]

84

Trust Score

1 verification

100% success
  1. 1

    Redis configuration at the point of running:

    Redis configuration at the point of running:

    text
    Connection sequence:
    
    ``` js
        before(function (done) {
            exec(createRedisCluster, [ 'start' ], { cwd: redisClusterCwd }, done);
        });
    
        before(function (done) {
            this.timeout(10000);
            exec(createRedisCluster, [ 'create' ], { cwd: redisClusterCwd }, done);
        });
    
        before(function () {
            this.service = require('../lib/service.js')(overwrite);
            return this.service;
        });
    
    
    // tests...
    
        after(function () {
            return this.service.call('close');
        });
    
        after(function (done) {
            exec(createRedisCluster, [ 'stop' ], { cwd: redisClusterCwd }, done);
        });
    
        after(function (done) {
            exec(createRedisCluster, [ 'clean' ], { cwd: redisClusterCwd }, done);
        });
    });

Validation

Resolved in redis/ioredis GitHub issue #56. Community reactions: 0 upvotes.

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

redisiorediscachebug