{"record":{"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":"error","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/90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58/packages/client/lib/sentinel/index.ts#L1800-L1836","documentation":"In `getReplicaNodes()`, the loop sets `connected = true` once a sentinel responds, but if every responding sentinel returns an empty replica list (`createNodeList` length 0), no replicas are returned and it throws 'No Replicas Nodes Enumerated'. It signals 'sentinels up, but no replicas known'.","triggerScenarios":"Calling `getReplicaNodes()` / `getReplicaClient()` when the topology has no replicas attached, or Sentinel has not yet discovered them, or all replicas are flagged out by `createNodeList`.","commonSituations":"Single-master deployment with no replicas; replicas still syncing/not yet discovered; replicas flagged down so filtered out; read-scaling expected but not provisioned.","solutions":["Provision replicas and attach them to the master.","Wait for Sentinel discovery to pick up newly added replicas.","Inspect `SENTINEL replicas <name>` on a live sentinel.","Fall back to reading from the master if no replicas are required."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"async function replicasAvailable(sentinel: { getReplicaNodes(): Promise<unknown[]> }): Promise<boolean> {\n  try { return (await sentinel.getReplicaNodes()).length > 0; }\n  catch { return false; }\n}","typeGuard":null,"tryCatchPattern":"let client;\ntry { client = await sentinel.getReplicaClient(); }\ncatch (e) {\n  if (String(e).includes('No Replicas Nodes Enumerated')) {\n    client = await sentinel.getMasterClient(); // degrade reads to master\n  } else throw e;\n}","preventionTips":["Provision replicas before enabling replica reads.","Build read paths that can fall back to the master when no replicas exist."],"tags":["sentinel","replicas","topology","discovery"],"backgroundTag":null,"analyzedSha":"90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58","analyzedAt":"2026-08-11T15:37:21.243Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}