{"record":{"id":"d9e5cbc882b5f8f6","repo":"redis/node-redis","slug":"redis-endpoints-config-path-must-be-set-when-re-cl","errorCode":null,"errorMessage":"REDIS_ENDPOINTS_CONFIG_PATH must be set when RE_CLUSTER=true","messagePattern":"REDIS_ENDPOINTS_CONFIG_PATH must be set when RE_CLUSTER=true","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/test-utils/lib/re-cluster.ts","lineNumber":47,"sourceCode":" * Docker servers.\n */\nexport function isReCluster(): boolean {\n  return (process.env.RE_CLUSTER ?? '').toLowerCase() === 'true';\n}\n\nlet cached: REConnection | undefined;\n\n/**\n * Resolves the managed Redis Enterprise database the suite should target, reading\n * the database named by RE_DB_NAME (default \"standalone\") from the endpoints config\n * at REDIS_ENDPOINTS_CONFIG_PATH - the same format consumed by the scenario tests.\n */\nexport function loadREConnection(): REConnection {\n  if (cached) return cached;\n\n  const path = process.env.REDIS_ENDPOINTS_CONFIG_PATH;\n  if (!path) {\n    throw new Error('REDIS_ENDPOINTS_CONFIG_PATH must be set when RE_CLUSTER=true');\n  }\n\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;","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/redis/node-redis/blob/90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58/packages/test-utils/lib/re-cluster.ts#L29-L65","documentation":"loadREConnection() throws when RE_CLUSTER=true is active but REDIS_ENDPOINTS_CONFIG_PATH is unset. That env var must point to a JSON file describing the Redis Enterprise databases — the same format the scenario tests consume. Without it, the loader cannot determine which managed database to target.","triggerScenarios":"Setting RE_CLUSTER=true without also providing REDIS_ENDPOINTS_CONFIG_PATH; running the suite in RE mode before the cae-client-testing pipeline has generated/mounted the endpoints config.","commonSituations":"CI job mounted the config but forgot to set the env var; locally toggling RE_CLUSTER without the config file; env var renamed; the config-generation step ran in a different shell than the tests.","solutions":["Generate or mount the endpoints JSON and export an absolute path: export REDIS_ENDPOINTS_CONFIG_PATH=/abs/path/endpoints.json.","If you did not mean to use RE mode, unset RE_CLUSTER (or set RE_CLUSTER=false) to fall back to local Docker servers.","Confirm the path is readable by the test process and points at the file you expect (ls -l $REDIS_ENDPOINTS_CONFIG_PATH).","Check for trailing whitespace or a missing export when assigning the variable."],"exampleFix":"# before\n export RE_CLUSTER=true                 # REDIS_ENDPOINTS_CONFIG_PATH unset -> throws\n\n# after\n export RE_CLUSTER=true\n export REDIS_ENDPOINTS_CONFIG_PATH=/etc/redis/endpoints.json\n npm run test","handlingStrategy":"validation","validationCode":"function assertEndpointsConfigPath(): string {\n  const path = process.env.REDIS_ENDPOINTS_CONFIG_PATH;\n  if (!path) {\n    throw new Error('Set REDIS_ENDPOINTS_CONFIG_PATH=<abs/path/endpoints.json> when RE_CLUSTER=true');\n  }\n  return path;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pair RE_CLUSTER=true with REDIS_ENDPOINTS_CONFIG_PATH in the same export block so they cannot drift.","Use an absolute path to avoid cwd-dependent failures.","Add a CI setup step that verifies the file exists and is readable before tests run.","If RE mode is optional, gate the suite on isReCluster() so the loader is never called without the config."],"tags":["test-utils","configuration","environment","redis-enterprise"],"backgroundTag":null,"analyzedSha":"90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58","analyzedAt":"2026-08-11T15:37:21.243Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}