affaan-m/ECC · error · Error

--config-dir must be an existing absolute directory.

Error message

--config-dir must be an existing absolute directory.

What it means

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.

Solutions

  1. Prefix the value with an absolute path, e.g. --config-dir /home/user/project/configs
  2. In scripts, expand it explicitly: --config-dir "$(pwd)/configs"
  3. Verify with a quick check: node -e "require('path').isAbsolute(process.argv[1])" "$CFG"

Example fix

// before
args.push('--config-dir', './configs/qual')
// after
const path = require('path');
args.push('--config-dir', path.resolve('configs/qual'))
Defensive patterns

Strategy: validation

Validate before calling

const path = require('path');
if (!path.isAbsolute(configDir)) throw new Error('config-dir must be absolute');

Type guard

const isAbsDir = (v) => typeof v === 'string' && require('path').isAbsolute(v);

Try / catch

try {
  runEccIto(configDir);
} catch (e) {
  if (e.message.includes('--config-dir must be an existing absolute')) {
    retryWith(path.resolve(configDir));
  } else throw e;
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/516c85656c41e461. Report an issue: GitHub.

Appendix: source

Thrown at scripts/ito.js:124

function validateNodeQualificationArgs(args, environment) {
  if (environment.ITO_ENABLE_SIXTYTWO_LIVE !== "1") {
    throw new Error(
      "Live node qualification requires ITO_ENABLE_SIXTYTWO_LIVE=1 before any process is started."
    );
  }
  if (args.filter((value) => value === "--live-sixtytwo").length !== 1) {
    throw new Error(
      "Live node qualification requires --live-sixtytwo exactly once before any process is started."
    );
  }
  requiredOptionValue(args, "--cluster");
  const nodes = requiredOptionValue(args, "--nodes");
  if (!nodes.split(",").every((node) => node.trim().length > 0)) {
    throw new Error("--nodes must explicitly list one or more non-empty nodes.");
  }
  const configDirectory = requiredOptionValue(args, "--config-dir");
  if (!path.isAbsolute(configDirectory)) {
    throw new Error("--config-dir must be an existing absolute directory.");
  }
  try {
    const resolved = fs.realpathSync.native(configDirectory);
    if (
      !fs.statSync(resolved).isDirectory()
      || !fs.statSync(path.join(resolved, "sixtytwo.yaml")).isFile()
    ) {
      throw new Error("invalid qualification configuration");
    }
  } catch {
    throw new Error(
      "--config-dir must exist and contain a regular sixtytwo.yaml before any process is started."
    );
  }
}

function parseArgs(argv, environment = process.env) {
  const args = [...argv];

View on GitHub (pinned to 8321021c54)