redis/node-redis · critical · Error
Couldn't connect to any sentinel node
Error message
Couldn't connect to any sentinel node
What it means
A discovery routine iterates the known sentinel root nodes to call `SENTINEL SENTINELS` and learn the full sentinel list; if no node could be connected to (every iteration `continue`d past failures), the loop ends and throws. It is the bootstrap-discovery counterpart to the observe() connectivity failure.
Solutions
- Confirm at least one sentinel seed is reachable and authenticated.
- Fix `sentinelClientOptions` password / TLS to match the sentinels.
- Open the sentinel port (default 26379) in the network/firewall.
- Supply additional healthy seeds in `rootNodes`.
Defensive patterns
Strategy: retry
Validate before calling
async function pingSentinels(rootNodes: { host: string; port: number }[]): Promise<boolean> {
for (const n of rootNodes) {
try {
const s = new net.Socket();
await new Promise<void>((res, rej) => { s.setTimeout(1000).once('connect', () => { s.destroy(); res(); }).once('error', rej).once('timeout', () => rej(new Error('timeout'))).connect(n.port, n.host); });
return true;
} catch { /* next */ }
}
return false;
} Try / catch
for (let i = 0; i < 5; i++) {
try { await sentinel.connect(); break; }
catch (e) {
if (String(e).includes("Couldn't connect to any sentinel node") && i < 4) {
await new Promise(r => setTimeout(r, 500 * 2 ** i)); continue;
}
throw e;
}
} Prevention
- Open sentinel ports in firewalls (default 26379).
- Keep >= 3 sentinel seeds across hosts/zones.
When it happens
Trigger: Calling the sentinel-list discovery path when every root node is unreachable or errors on `SENTINEL SENTINELS`. Reached during initial connect / topology refresh.
Common situations: Cold start with all seed sentinels down; wrong sentinel port; auth mismatch on sentinelClientOptions; firewall blocking the sentinel port (commonly 26379).
Related errors
- None of the sentinels are available
- couldn't connect to any sentinels
- All the root nodes are unavailable
- Master Node Not Enumerated
- No Replicas Nodes Enumerated
AI-assisted analysis of redis/node-redis@90fd0652bc (2026-08-11).
Data as JSON: /api/errors/4b4c5d63792030d1.
Report an issue: GitHub.
Appendix: source
Thrown at packages/client/lib/sentinel/index.ts:1714
try {
await client.connect();
} catch {
if (client.isOpen) {
client.destroy();
}
continue;
}
try {
const sentinelData = await client.sentinel.sentinelSentinels(this.options.name);
this.#sentinelRootNodes = [node].concat(createNodeList(sentinelData));
return;
} finally {
client.destroy();
}
}
throw new Error("Couldn't connect to any sentinel node");
}
async getMasterNode() {
let connected = false;
for (const node of this.#sentinelRootNodes) {
const client = RedisClient.create({
...this.options.sentinelClientOptions,
socket: {
...this.options.sentinelClientOptions?.socket,
host: node.host,
port: node.port,
reconnectStrategy: false
},
modules: RedisSentinelModule
}).on('error', err => this.emit(`getMasterNode: ${err}`));
try {View on GitHub (pinned to 90fd0652bc)