coleam00/Archon · error · Error

Cannot resume container run '${resumable?.id ?? '?'}': its i

Error message

Cannot resume container run '${resumable?.id ?? '?'}': its isolation env id is missing from the run metadata. Start a fresh --container run instead.

What it means

Resuming a container run requires the isolation environment id recorded in the run's metadata (`metadata.isolation_env_id`) so the CLI can rediscover and restart the persisted container overlay volume. If the field is absent (older runs written before the field existed, or corrupted metadata), the container cannot be safely restarted, so the CLI throws and advises a fresh --container run.

Source

Thrown at packages/cli/src/commands/workflow.ts:2519

      if (options.resume) {
        // Rediscover + restart the container for this run: `docker start` a
        // suspended container, or recreate one over the persisted upper volume
        // (the accumulated overlay is preserved). The env id was stamped into the
        // run metadata at first-run creation. resumeEnv fails LOUD if the volume
        // is gone (un-applied work lost) rather than restarting from empty.
        //
        // Ordering (L3): the container is restarted FIRST (here) even on a
        // write-back-only resume where no DAG node will re-execute — kept uniform
        // with the mid-DAG-approval resume, which DOES need a live container. The
        // subsequent write-back apply runs in an INDEPENDENT `docker run` helper
        // over the volume (see overlay.ts), so it neither needs nor races the
        // restarted run container.
        const resumeEnvId =
          typeof resumable?.metadata?.isolation_env_id === 'string'
            ? resumable.metadata.isolation_env_id
            : undefined;
        if (!resumeEnvId) {
          throw new Error(
            `Cannot resume container run '${resumable?.id ?? '?'}': its isolation env id is ` +
              'missing from the run metadata. Start a fresh --container run instead.'
          );
        }
        console.log(`Folder project — resuming container run (image ${containerConfig.image}).`);
        getLog().info(
          { envId: resumeEnvId, image: containerConfig.image },
          'workflow.resuming_in_container'
        );
        try {
          prepared = await backend.resumeEnv(resumeEnvId);
        } catch (resumeErr) {
          const err = resumeErr as Error;
          getLog().error({ err, envId: resumeEnvId }, 'workflow.container_resume_failed');
          throw new Error(classifyIsolationError(err));
        }
      } else {
        console.log(`Folder project — running in container (image ${containerConfig.image}).`);

View on GitHub (pinned to 0773b97458)

Solutions

  1. Start a fresh container run with --container instead of resuming (as the message advises).
  2. Check `archon workflow get <runId>` to inspect the run metadata and confirm the field is truly missing.
  3. If the overlay volume still exists, a new --container run will create/reuse storage per current backend semantics rather than resuming the stale record.
  4. Avoid resuming runs created by older versions; migrate by launching a new run.

Example fix

// before
archon workflow run my-flow --resume  # isolation env id missing from run metadata
// after
archon workflow run my-flow --folder --container   # fresh container run
Defensive patterns

Strategy: type-guard

Validate before calling

const run = await workflowDb.getWorkflowRun(id);
if (run?.metadata?.isolation === 'container' && typeof run.metadata.isolation_env_id !== 'string') {
  console.error(`Run ${id} predates isolation_env_id stamping; start a fresh --container run instead of resuming.`);
}

Type guard

function isResumableContainerRun(r: WorkflowRun): r is WorkflowRun & { metadata: { isolation: 'container'; isolation_env_id: string } } {
  return (
    r.metadata?.isolation === 'container' &&
    typeof r.metadata?.isolation_env_id === 'string' &&
    r.metadata.isolation_env_id.length > 0
  );
}

Try / catch

try {
  await runWorkflow({ resume: true });
} catch (error) {
  if ((error as Error).message.includes('isolation env id is missing')) {
    console.error('Run metadata lacks isolation_env_id (older version?); launch a fresh --container run.');
  } else throw error;
}

Prevention

When it happens

Trigger: Running `archon workflow run <flow> --resume` for a run whose metadata.isolation is 'container' but whose metadata.isolation_env_id is missing or not a string — e.g. the run was created by an older binary version that did not stamp isolation_env_id.

Common situations: Upgrading Archon and resuming a pre-upgrade container run; a run row created through a path that skipped metadata stamping; manually edited or partially written run metadata.

Related errors


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