affaan-m/ECC · error · Error

Live node qualification requires --live-sixtytwo exactly…

Error message

Live node qualification requires --live-sixtytwo exactly once before any process is started.

What it means

validateNodeQualificationArgs() requires the --live-sixtytwo flag to appear exactly once as an explicit, deliberate opt-in to live qualification. Zero occurrences means the caller did not request live mode explicitly; duplicates are ambiguous. The check runs before any process is started.

Solutions

  1. Add exactly one --live-sixtytwo flag to the command (plus ITO_ENABLE_SIXTYTWO_LIVE=1).
  2. Remove duplicate --live-sixtytwo occurrences, keeping one.
  3. In wrapper scripts, append the flag only if not already present in the argument array.

Example fix

// before
ITO_ENABLE_SIXTYTWO_LIVE=1 ito --cluster prod --nodes node-a
// after
ITO_ENABLE_SIXTYTWO_LIVE=1 ito --live-sixtytwo --cluster prod --nodes node-a
Defensive patterns

Strategy: validation

Validate before calling

if (args.filter(a => a === '--live-sixtytwo').length !== 1) { throw new Error('--live-sixtytwo must appear exactly once'); }

Try / catch

try { runQualification(args); } catch (e) { if (e.message.includes('--live-sixtytwo')) { console.error('Pass --live-sixtytwo exactly once along with ITO_ENABLE_SIXTYTWO_LIVE=1'); process.exit(2); } throw e; }

Prevention

When it happens

Trigger: Calling the qualification entry point without --live-sixtytwo (relying on ITO_ENABLE_SIXTYTWO_LIVE alone), or passing --live-sixtytwo twice, so the filter count !== 1.

Common situations: Users who set the env var but forget the flag, assuming either alone suffices (both are required); duplicated flag after wrapping/composing commands; scripts appending the flag to a command that already includes it.

Understand the failure class

Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at scripts/ito.js:113

    .filter((index) => index >= 0);
  if (indexes.length !== 1) {
    throw new Error(`${option} is required exactly once for live node qualification.`);
  }
  const value = args[indexes[0] + 1];
  if (!value?.trim() || value.startsWith("--")) {
    throw new Error(`${option} requires a non-empty value for live node qualification.`);
  }
  return value;
}

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()
    ) {

View on GitHub (pinned to 8321021c54)