{"id":"b7ffaedadba1fa90","repo":"redis/node-redis","slug":"no-replicas-nodes-enumerated","errorCode":null,"errorMessage":"No Replicas Nodes Enumerated","messagePattern":"No Replicas Nodes Enumerated","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/client/lib/sentinel/index.ts","lineNumber":1818,"sourceCode":"\n      connected = true;\n\n      try {\n        const replicaData = await client.sentinel.sentinelReplicas(this.options.name);\n\n        const replicas = createNodeList(replicaData);\n        if (replicas.length == 0) {\n          continue;\n        }\n\n        return replicas;\n      } finally {\n        client.destroy();\n      }\n    }\n\n    if (connected) {\n      throw new Error(\"No Replicas Nodes Enumerated\");\n    }\n\n    throw new Error(\"couldn't connect to any sentinels\");\n  }\n\n  async getReplicaClient() {\n    const replicas = await this.getReplicaNodes();\n    if (replicas.length == 0) {\n      throw new Error(\"no available replicas\");\n    }\n\n    this.#replicaIdx++;\n    if (this.#replicaIdx >= replicas.length) {\n      this.#replicaIdx = 0;\n    }\n\n    const replica = replicas[this.#replicaIdx];\n    const socket = getMappedNode(replica.host, replica.port, this.options.nodeAddressMap);","sourceCodeStart":1800,"sourceCodeEnd":1836,"githubUrl":"https://github.com/redis/node-redis/blob/bb5beb56578573910e2ee8f39681edc214c41398/packages/client/lib/sentinel/index.ts#L1800-L1836","documentation":"Thrown by RedisSentinelFactory.getReplicaNodes() when `connected` is true (a sentinel was reached) but createNodeList(replicaData) returned an empty list for every sentinel (sentinel/index.ts:1817). The sentinel is up and knows the master, but reports zero online replicas.","triggerScenarios":"Calling getReplicaNodes() on a sentinel-monitored deployment that has no replicas configured, or where all replicas are down/deselected so SENTINEL REPLICAS returns none.","commonSituations":"Single-node (master-only) Sentinel setup; replicas still spinning up; all replicas in sdown so the sentinel lists none; expecting read scaling without provisioning replicas.","solutions":["Provision at least one replica for the monitored master (`replicaof` in redis.conf).","Verify with `redis-cli -p 26379 sentinel replicas <name>` that the sentinel sees online replicas.","If you don't need replicas, don't call getReplicaNodes()/getReplicaClient().","Wait for replicas to come online and retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before relying on replicas, check the sentinel sees at least one.\nasync function assertHasReplicas(sentinelNode, name) {\n  const c = createClient({ socket: sentinelNode });\n  c.on('error', () => {});\n  await c.connect();\n  try {\n    const replicas = await c.sentinel.sentinelReplicas(name);\n    if (!replicas || replicas.length === 0) throw new Error('no replicas visible to sentinel');\n  } finally {\n    await c.destroy();\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  const replicas = await factory.getReplicaNodes();\n} catch (e) {\n  if (e instanceof Error && /No Replicas Nodes Enumerated/.test(e.message)) {\n    // no replicas provisioned — fall back to master reads\n  }\n  throw e;\n}","preventionTips":["Provision at least one replica before enabling replica reads.","Verify with `SENTINEL REPLICAS <name>` that replicas are online.","Don't call getReplicaNodes()/getReplicaClient() if you don't need read scaling."],"tags":["sentinel","replicas","configuration","factory"],"analyzedSha":"bb5beb56578573910e2ee8f39681edc214c41398","analyzedAt":"2026-08-03T19:09:15.686Z","schemaVersion":2}