affaan-m/ECC · error · Error

Multiple ECC repo roots detected: ${uniqueRepoRoots.join(',

Error message

Multiple ECC repo roots detected: ${uniqueRepoRoots.join(', ')}

What it means

launch_terminal() resolves the given path with os.path.realpath and refuses to spawn a terminal unless the result is an existing directory (os.path.isdir). This guards against typos, deleted directories, and file (not directory) paths before invoking the platform-specific terminal launcher. The error message reports the canonical resolved path so you can see exactly what was checked.

Source

Thrown at scripts/auto-update.js:226

        installStatePath: record.installStatePath,
        status: 'error',
        error: record.error || 'No valid install-state available'
      });
      continue;
    }

    const recordRepoRoot = requestedRepoRoot || validateRepoRoot(deriveRepoRootFromState(record.state));
    inferredRepoRoots.push(recordRepoRoot);
    validRecords.push({
      record,
      repoRoot: recordRepoRoot
    });
  }

  if (!requestedRepoRoot) {
    const uniqueRepoRoots = [...new Set(inferredRepoRoots)];
    if (uniqueRepoRoots.length > 1) {
      throw new Error(`Multiple ECC repo roots detected: ${uniqueRepoRoots.join(', ')}`);
    }
  }

  const repoRoot = requestedRepoRoot || inferredRepoRoots[0] || null;
  if (!repoRoot) {
    return {
      dryRun: Boolean(options.dryRun),
      repoRoot,
      results,
      summary: {
        checkedCount: results.length,
        updatedCount: 0,
        errorCount: results.length
      }
    };
  }

  const env = {

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Verify the directory exists immediately before calling: os.path.isdir(path).
  2. Pass an absolute path to an existing directory.
  3. If the directory may have been removed, re-detect or recreate it before launching.

Example fix

# before
launch_terminal(project_path)  # project_path is a file or deleted

# after
import os
canonical = os.path.realpath(project_path)
if not os.path.isdir(canonical):
    raise SystemExit(f'Cannot open terminal: {canonical} is not a directory')
launch_terminal(canonical)
Defensive patterns

Strategy: validation

Validate before calling

# Validate the directory exists before launching a terminal.
import os
canonical = os.path.realpath(path)
if not os.path.isdir(canonical):
    raise SystemExit(f'Refusing to open terminal: {canonical!r} is not an existing directory')
launch_terminal(canonical)

Type guard

import os

def is_existing_directory(p) -> bool:
    return os.path.isdir(os.path.realpath(p))

Try / catch

try:
    launch_terminal(project_path)
except ValueError as e:
    # e.message reports the resolved path that failed the isdir check.
    log.error('cannot open terminal: %s', e)
    # re-detect the project root and retry, or surface to user

Prevention

When it happens

Trigger: Passing a file path (not a directory); passing a path to a directory that was deleted; passing a relative path that resolves somewhere unexpected; passing a path whose final component is a symlink to a file.

Common situations: A project directory was deleted between detection and the launch call; the caller passed a file path by mistake; a stale cached project root; the path points to a zip/tarball rather than an extracted directory.

Related errors


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