coleam00/Archon · warning

Status: Failed - ${err.message}

Error message

  Status: Failed - ${err.message}

What it means

isolationCleanupCommand prints this per-environment failure line when destroying a git worktree/execution environment fails during `archon isolation cleanup`. The underlying error is logged as 'worktree_destroy_failed' with the env id and path; the message surfaces err.message to the operator and the summary counts it as failed.

Source

Thrown at packages/cli/src/commands/isolation.ts:154

      console.log(`  Status: Skipped — run ${liveRun.id.slice(0, 8)} is ${liveRun.status}`);
      skipped++;
      continue;
    }

    try {
      await provider.destroy(env.working_path, {
        branchName: env.branch_name ? toBranchName(env.branch_name) : undefined,
        canonicalRepoPath: toRepoPath(env.codebase_default_cwd),
      });

      await isolationDb.updateStatus(env.id, 'destroyed');
      console.log('  Status: Cleaned');
      cleaned++;
    } catch (error) {
      const err = error as Error;
      getLog().warn({ err, envId: env.id, path: env.working_path }, 'worktree_destroy_failed');
      console.error(`  Status: Failed - ${err.message}`);
      failed++;
    }
  }

  console.log(
    `\nCleanup complete: ${String(cleaned)} cleaned, ${String(skipped)} skipped, ${String(failed)} failed`
  );

  // Reap orphaned container environments (terminal / run-less, older than the
  // threshold). Paused runs' containers are deliberately skipped (awaited state).
  const containerReport = await cleanupContainerEnvironments(daysStale);
  const containerTotal =
    containerReport.removed.length + containerReport.skipped.length + containerReport.errors.length;
  if (containerTotal > 0) {
    console.log('\nContainer environments:');
    for (const id of containerReport.removed) {
      console.log(`  Removed: ${id.slice(0, 8)}`);
    }
    for (const s of containerReport.skipped) {

View on GitHub (pinned to 0773b97458)

Solutions

  1. Close processes holding the worktree open (check the logged path in 'worktree_destroy_failed'), then re-run cleanup
  2. If the directory is already gone, prune stale git metadata (git worktree prune) so Archon's records match disk
  3. Remove the directory manually with adequate permissions, then re-run cleanup to clear the record
  4. Re-run `archon isolation cleanup` — skipped/locked entries may succeed once the run has finished
Defensive patterns

Strategy: try-catch

Validate before calling

// before cleanup, verify the worktree path exists and is unused
if (!existsSync(env.working_path)) {
  getLog().warn({ envId: env.id }, 'worktree_path_missing_before_destroy');
}
const { stdout } = Bun.spawnSync(['git', '-C', env.working_path, 'status', '--porcelain']);
const busy = stdout.toString().length === 0 && isProcessUsingPath(env.working_path);

Type guard

function isFsError(err: unknown): err is NodeJS.ErrnoException {
  return err instanceof Error && 'code' in err;
}

Try / catch

try {
  await destroyWorktree(env);
} catch (err) {
  getLog().warn({ err, envId: env.id, path: env.working_path }, 'worktree_destroy_failed');
  failed++;
}

Prevention

When it happens

Trigger: Running `archon isolation cleanup` when worktree destruction throws — the working_path no longer exists, permissions deny removal, files are held open/locked by a running process, or the git repo/worktree metadata is corrupt or already pruned.

Common situations: A workflow run still holds the worktree open (editor, dev server, agent process); the checkout was deleted manually out from under Archon; running cleanup without filesystem permissions; stale worktrees on an unmounted volume.

Related errors


AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01). Data as JSON: /api/errors/516790315ab34c60. Report an issue: GitHub.