affaan-m/ECC · error · Error

Missing value for --family

Error message

Missing value for --family

What it means

When _validate_file_path() is called with must_exist=True, it raises ValueError if the resolved path does not exist on disk. This is used for import/read targets that must already be present, as opposed to output paths that may be created on write. The error reports the fully resolved path.

Source

Thrown at scripts/catalog.js:79

  };

  if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
    parsed.help = true;
    return parsed;
  }

  parsed.command = args[0];

  for (let index = 1; index < args.length; index += 1) {
    const arg = args[index];

    if (arg === '--help' || arg === '-h') {
      parsed.help = true;
    } else if (arg === '--json') {
      parsed.json = true;
    } else if (arg === '--family') {
      if (!args[index + 1]) {
        throw new Error('Missing value for --family');
      }
      parsed.family = normalizeFamily(args[index + 1]);
      index += 1;
    } else if (arg === '--target') {
      if (!args[index + 1]) {
        throw new Error('Missing value for --target');
      }
      parsed.target = args[index + 1];
      index += 1;
    } else if (parsed.command === 'show' && !parsed.componentId) {
      parsed.componentId = arg;
    } else {
      throw new Error(`Unknown argument: ${arg}`);
    }
  }

  return parsed;
}

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Verify the file exists with Path(path).exists() before calling with must_exist=True.
  2. Correct the path or re-detect it from the source directory listing.
  3. Ensure the script runs from the intended working directory, or pass an absolute path.

Example fix

# before
_validate_file_path(instinct_path, must_exist=True)  # file moved

# after
from pathlib import Path
p = Path(instinct_path).expanduser().resolve()
if not p.exists():
    raise SystemExit(f'Instinct file not found: {p}')
_validate_file_path(str(p), must_exist=True)
Defensive patterns

Strategy: validation

Validate before calling

# Confirm the file exists before importing with must_exist=True.
from pathlib import Path
p = Path(instinct_path).expanduser().resolve()
if not p.exists():
    raise SystemExit(f'cannot import: file does not exist: {p}')
_validate_file_path(str(p), must_exist=True)

Type guard

from pathlib import Path

def file_exists(p) -> bool:
    return Path(p).expanduser().resolve().exists()

Try / catch

try:
    _validate_file_path(path, must_exist=True)
except ValueError as e:
    if 'does not exist' in str(e):
        # re-list the directory to suggest the correct filename
        log.error('file missing; available: %s', list(parent_dir.iterdir()))
    raise

Prevention

When it happens

Trigger: Importing an instinct file that was moved or deleted; a typo in the filename; a relative path resolved from the wrong working directory; a file that exists only on a different machine/branch.

Common situations: The file was deleted between listing and import; the script's cwd differs from what the caller assumed; a stale path reference persisted after a refactor/rename.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/8d1ff66d0716854a. Report an issue: GitHub.