{"record":{"id":"99f2e354f47c0015","repo":"redis/node-redis","slug":"no-endpoints-found-for-database-name-in-path","errorCode":null,"errorMessage":"No endpoints found for database ${name} in ${path}","messagePattern":"No endpoints found for database (.+?) in (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/test-utils/lib/re-cluster.ts","lineNumber":67,"sourceCode":"\n  const data = JSON.parse(readFileSync(path, 'utf-8')) as REDatabasesConfig;\n  const name = process.env.RE_DB_NAME || 'standalone';\n  const db = data[name] ?? Object.values(data)[0];\n  if (!db) {\n    throw new Error(`Database ${name} not found in ${path}`);\n  }\n\n  let host: string;\n  let port: number;\n  if (db.raw_endpoints && db.raw_endpoints.length > 0) {\n    host = db.raw_endpoints[0].dns_name;\n    port = db.raw_endpoints[0].port;\n  } else if (db.endpoints && db.endpoints.length > 0) {\n    const parsed = new URL(db.endpoints[0]);\n    host = parsed.hostname;\n    port = parsed.port ? Number(parsed.port) : parsed.protocol === 'rediss:' ? 6380 : 6379;\n  } else {\n    throw new Error(`No endpoints found for database ${name} in ${path}`);\n  }\n\n  cached = {\n    host,\n    port,\n    username: db.username || undefined,\n    password: db.password || undefined,\n    tls: db.tls\n  };\n  return cached;\n}\n","sourceCodeStart":49,"sourceCodeEnd":79,"githubUrl":"https://github.com/redis/node-redis/blob/90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58/packages/test-utils/lib/re-cluster.ts#L49-L79","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before — entry present but no endpoints\n{\n  \"standalone\": { \"tls\": false }\n}\n\n// after — raw_endpoints populated\n{\n  \"standalone\": {\n    \"tls\": false,\n    \"raw_endpoints\": [{ \"dns_name\": \"re-host\", \"port\": 12000 }]\n  }\n}","handlingStrategy":"validation","validationCode":"function databaseHasEndpoints(db: { raw_endpoints?: unknown[]; endpoints?: unknown[] }): boolean {\n  return (!!db.raw_endpoints && db.raw_endpoints.length > 0) || (!!db.endpoints && db.endpoints.length > 0);\n}\n// after selecting db in loadREConnection, before deriving host/port:\nif (!databaseHasEndpoints(db)) {\n  throw new Error(`Database entry has no raw_endpoints/endpoints; regenerate config after provisioning`);\n}","typeGuard":"const hasRawEndpoints = (db: unknown): boolean =>\n  typeof db === 'object' && db !== null && Array.isArray((db as { raw_endpoints?: unknown[] }).raw_endpoints) && ((db as { raw_endpoints: unknown[] }).raw_endpoints.length > 0);","tryCatchPattern":null,"preventionTips":["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."],"tags":["test-utils","configuration","redis-enterprise","network"],"backgroundTag":null,"analyzedSha":"90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58","analyzedAt":"2026-08-11T15:37:21.243Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}