redis/node-redis · error · Error
No endpoints found for database ${name} in ${path}
Error message
No endpoints found for database ${name} in ${path} What it means
loadREConnection() throws when the selected database entry exists in the config but has neither a non-empty raw_endpoints array (with dns_name/port) nor a non-empty endpoints array (URL strings). With no connectable address derivable from either field, the loader cannot produce a host/port for the client.
Source
Thrown at packages/test-utils/lib/re-cluster.ts:67
const data = JSON.parse(readFileSync(path, 'utf-8')) as REDatabasesConfig;
const name = process.env.RE_DB_NAME || 'standalone';
const db = data[name] ?? Object.values(data)[0];
if (!db) {
throw new Error(`Database ${name} not found in ${path}`);
}
let host: string;
let port: number;
if (db.raw_endpoints && db.raw_endpoints.length > 0) {
host = db.raw_endpoints[0].dns_name;
port = db.raw_endpoints[0].port;
} else if (db.endpoints && db.endpoints.length > 0) {
const parsed = new URL(db.endpoints[0]);
host = parsed.hostname;
port = parsed.port ? Number(parsed.port) : parsed.protocol === 'rediss:' ? 6380 : 6379;
} else {
throw new Error(`No endpoints found for database ${name} in ${path}`);
}
cached = {
host,
port,
username: db.username || undefined,
password: db.password || undefined,
tls: db.tls
};
return cached;
}
View on GitHub (pinned to 90fd0652bc)
Solutions
- Regenerate the endpoints config after the database has been assigned endpoints so raw_endpoints or endpoints is populated.
- Ensure each database entry includes raw_endpoints: [{ dns_name, port }] or endpoints: ['redis://host:port'] (or 'rediss://' for TLS).
- Verify the schema matches REDatabaseConfig (raw_endpoints with dns_name+port, or endpoints as URL strings) and that db.tls is set.
- If endpoints are represented differently, normalize the config to the expected shape before running the suite.
Example fix
// before — entry present but no endpoints
{
"standalone": { "tls": false }
}
// after — raw_endpoints populated
{
"standalone": {
"tls": false,
"raw_endpoints": [{ "dns_name": "re-host", "port": 12000 }]
}
} Defensive patterns
Strategy: validation
Validate before calling
function databaseHasEndpoints(db: { raw_endpoints?: unknown[]; endpoints?: unknown[] }): boolean {
return (!!db.raw_endpoints && db.raw_endpoints.length > 0) || (!!db.endpoints && db.endpoints.length > 0);
}
// after selecting db in loadREConnection, before deriving host/port:
if (!databaseHasEndpoints(db)) {
throw new Error(`Database entry has no raw_endpoints/endpoints; regenerate config after provisioning`);
} Type guard
const hasRawEndpoints = (db: unknown): boolean =>
typeof db === 'object' && db !== null && Array.isArray((db as { raw_endpoints?: unknown[] }).raw_endpoints) && ((db as { raw_endpoints: unknown[] }).raw_endpoints.length > 0); Prevention
- Regenerate the endpoints config only after the database has bound endpoints.
- Ensure each entry includes raw_endpoints:[{dns_name,port}] or endpoints:['redis(s)://host:port'].
- Validate the REDatabaseConfig schema (raw_endpoints vs endpoints, db.tls) in CI before tests.
- If endpoints are represented under different field names, normalize the config to the expected shape.
When it happens
Trigger: The database object in the endpoints JSON is present but its raw_endpoints and endpoints arrays are both missing or empty — e.g., the database exists in config but has not yet been assigned a port/bound endpoint.
Common situations: Config captured before endpoint assignment completed; database not yet provisioned or bound; schema drift where the fields are named differently (e.g., 'host'/'port' at top level instead of inside raw_endpoints); partial config written by a failed pipeline step.
Related errors
- RE_FAULT_INJECTOR_URL environment variable must be set
- REDIS_ENDPOINTS_CONFIG_PATH must be set when RE_CLUSTER=true
- Database ${name} not found in ${path}
- Invalid JSON configuration: ${error}
- Config file not found at path: ${path}
AI-assisted analysis of redis/node-redis@90fd0652bc (2026-08-11).
Data as JSON: /api/errors/99f2e354f47c0015.
Report an issue: GitHub.