{"record":{"id":"5b7d834bbf82cd74","repo":"affaan-m/ECC","slug":"config-dir-must-exist-and-contain-a-regular-sixt","errorCode":null,"errorMessage":"--config-dir must exist and contain a regular sixtytwo.yaml before any process is started.","messagePattern":"--config-dir must exist and contain a regular sixtytwo\\.yaml before any process is started\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/ito.js","lineNumber":135,"sourceCode":"  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];\n  if (\n    args.length === 0\n    || args.includes(\"--help\")\n    || args.includes(\"-h\")\n  ) {\n    return Object.freeze({ help: true, invocationArgs: [] });\n  }\n\n  if (environment.ECC_DRY_RUN === \"1\" || args.includes(\"--dry-run\")) {\n    throw new Error(\n      \"Itô compute has no paper or dry-run success mode. No CLI operation was invoked.\"","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/ito.js#L117-L153","documentation":"Thrown by the catch block at scripts/ito.js:134-137 of validateNodeQualificationArgs. It fires for ANY failure inside the preceding try{}: fs.realpathSync.native failing (ENOENT, EACCES), fs.statSync failing, the inner validation throw at line 132, or the isDirectory/isFile checks returning false. Because the catch is parameter-less and unconditional, this single message masks three distinct failure modes (path resolution, dir-ness, file-ness). It is the message users actually see when --config-dir is wrong for `ecc ito evals`.","triggerScenarios":"`ecc ito evals --cluster <id> --live-sixtytwo --nodes <list> --config-dir <abs>` where <abs> does not exist, is not readable, is not a directory, OR does not contain a regular file named exactly sixtytwo.yaml. Also fires when sixtytwo.yaml exists but is a directory or special file.","commonSituations":"Operator forgot to create the config dir; or created it but mistyped the yaml filename (sixtyTwo.yaml, sixtytwo.yml — the check is case-sensitive and only accepts sixtytwo.yaml); or pointed at a symlink loop / permission-restricted path. Also commonly hit when copying a config layout from another machine without the yaml file.","solutions":["Verify the path exists and is a directory: `test -d \"$CONFIG_DIR\" && ls -la \"$CONFIG_DIR\"`.","Verify sixtytwo.yaml exists as a regular file with the exact name: `test -f \"$CONFIG_DIR/sixtytwo.yaml\"`.","Check permissions on every path component (realpathSync and statSync both need read/traverse): `namei -l \"$CONFIG_DIR/sixtytwo.yaml\"`.","Resolve symlinks manually first (`readlink -f`) to confirm what realpathSync.native will return."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const fs = require('fs');\nconst path = require('path');\nfunction preflightConfigDir(configDirectory) {\n  const errors = [];\n  let resolved;\n  try { resolved = fs.realpathSync.native(configDirectory); }\n  catch (e) { errors.push(`cannot resolve: ${e.message}`); return errors; }\n  if (!fs.statSync(resolved).isDirectory()) errors.push(`${resolved} is not a directory`);\n  const yaml = path.join(resolved, 'sixtytwo.yaml');\n  try { if (!fs.statSync(yaml).isFile()) errors.push(`${yaml} is not a regular file`); }\n  catch (e) { errors.push(`${yaml} missing or unreadable: ${e.message}`); }\n  return errors;\n}\n// run before `ecc ito evals`\nconst issues = preflightConfigDir(process.env.ITO_CONFIG_DIR);\nif (issues.length) { console.error(issues); process.exit(1); }","typeGuard":null,"tryCatchPattern":"try {\n  // call ecc ito evals via spawn\n} catch (err) {\n  if (err.message.includes('--config-dir must exist and contain a regular sixtytwo.yaml')) {\n    // re-run preflightConfigDir to give the operator the precise failure\n  }\n}","preventionTips":["Keep the config layout under version control with the exact filename sixtytwo.yaml (case-sensitive, .yaml not .yml).","Run a preflight check (realpath + stat) in CI before any evals invocation.","After cloning configs across machines, verify file mode and ownership on the directory and yaml."],"tags":["cli","validation","config","filesystem","ito","evals"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}