{"record":{"id":"516c85656c41e461","repo":"affaan-m/ECC","slug":"config-dir-must-be-an-existing-absolute-director","errorCode":null,"errorMessage":"--config-dir must be an existing absolute directory.","messagePattern":"--config-dir must be an existing absolute directory\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/ito.js","lineNumber":124,"sourceCode":"function validateNodeQualificationArgs(args, environment) {\n  if (environment.ITO_ENABLE_SIXTYTWO_LIVE !== \"1\") {\n    throw new Error(\n      \"Live node qualification requires ITO_ENABLE_SIXTYTWO_LIVE=1 before any process is started.\"\n    );\n  }\n  if (args.filter((value) => value === \"--live-sixtytwo\").length !== 1) {\n    throw new Error(\n      \"Live node qualification requires --live-sixtytwo exactly once before any process is started.\"\n    );\n  }\n  requiredOptionValue(args, \"--cluster\");\n  const nodes = requiredOptionValue(args, \"--nodes\");\n  if (!nodes.split(\",\").every((node) => node.trim().length > 0)) {\n    throw new Error(\"--nodes must explicitly list one or more non-empty nodes.\");\n  }\n  const configDirectory = requiredOptionValue(args, \"--config-dir\");\n  if (!path.isAbsolute(configDirectory)) {\n    throw new Error(\"--config-dir must be an existing absolute directory.\");\n  }\n  try {\n    const resolved = fs.realpathSync.native(configDirectory);\n    if (\n      !fs.statSync(resolved).isDirectory()\n      || !fs.statSync(path.join(resolved, \"sixtytwo.yaml\")).isFile()\n    ) {\n      throw new Error(\"invalid qualification configuration\");\n    }\n  } catch {\n    throw new Error(\n      \"--config-dir must exist and contain a regular sixtytwo.yaml before any process is started.\"\n    );\n  }\n}\n\nfunction parseArgs(argv, environment = process.env) {\n  const args = [...argv];","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/ito.js#L106-L142","documentation":"validateNodeQualificationArgs requires the --config-dir option to be an absolute path. It throws when the value is relative or missing absoluteness. This runs before any process starts so that the later filesystem resolution (realpathSync) works against a fully specified directory.","triggerScenarios":"Running `ecc ito evals ... --config-dir ./configs/qual` or `--config-dir ../shared/config` — any non-absolute path value, or an entirely absent --config-dir (which first fails requiredOptionValue and surfaces as this class of validation failure).","commonSituations":"Passing a project-relative path from a shell in a different cwd; scripts using `$(pwd)/conf` incompletely expanded; assuming the CLI resolves relative to the repo root.","solutions":["Prefix the value with an absolute path, e.g. --config-dir /home/user/project/configs","In scripts, expand it explicitly: --config-dir \"$(pwd)/configs\"","Verify with a quick check: node -e \"require('path').isAbsolute(process.argv[1])\" \"$CFG\""],"exampleFix":"// before\nargs.push('--config-dir', './configs/qual')\n// after\nconst path = require('path');\nargs.push('--config-dir', path.resolve('configs/qual'))","handlingStrategy":"validation","validationCode":"const path = require('path');\nif (!path.isAbsolute(configDir)) throw new Error('config-dir must be absolute');","typeGuard":"const isAbsDir = (v) => typeof v === 'string' && require('path').isAbsolute(v);","tryCatchPattern":"try {\n  runEccIto(configDir);\n} catch (e) {\n  if (e.message.includes('--config-dir must be an existing absolute')) {\n    retryWith(path.resolve(configDir));\n  } else throw e;\n}","preventionTips":["Always expand relative paths with path.resolve()/$(pwd) before passing to CLIs","Never rely on ~ expansion inside env vars or node-invoked CLIs","Centralize config-dir construction in one helper that enforces absoluteness"],"tags":["cli","path","validation"],"backgroundTag":"invalid-argument-value","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}