coleam00/Archon · error · Error
Cannot resume workflow '${workflowName}': failed to load pri
Error message
Cannot resume workflow '${workflowName}': failed to load prior run state — ${err.message} What it means
When resuming, the CLI hydrates prior run state so execution can continue from completed nodes; if loading that state throws, the error is re-thrown with the workflow name and original message, telling the user the prior run's state could not be loaded (logged as 'cli.workflow_hydrate_resume_failed').
Source
Thrown at packages/cli/src/commands/workflow.ts:2968
);
}
// When --resume, hand the already-found run (and its completed-node outputs)
// to executeWorkflow. Otherwise this is a fresh run and prepared stays null.
// The lookup-by-(workflowName, cwd) was already done above for worktree-path
// resolution; reuse that result rather than querying twice.
const deps = createWorkflowDeps();
let prepared: Awaited<ReturnType<typeof hydrateResumableRun>> = null;
if (options.resume && resumable) {
try {
prepared = await hydrateResumableRun(deps, resumable);
} catch (error) {
const err = error as Error;
getLog().error(
{ err, workflowName, runId: resumable.id },
'cli.workflow_hydrate_resume_failed'
);
throw new Error(
`Cannot resume workflow '${workflowName}': failed to load prior run state — ${err.message}`
);
}
if (!prepared) {
throw new Error(
`Cannot resume: the prior run for '${workflowName}' has no completed nodes and no interactive-loop state.`
);
}
}
// Execute workflow with workingCwd (may be worktree path). `undefined` until
// assigned so the finally-block teardown can tell "threw before a result" from
// a real terminal/paused result.
let result: Awaited<ReturnType<typeof executeWorkflow>> | undefined;
// A genuine container-teardown failure captured in the finally, rethrown AFTER
// the finally when the run itself succeeded — so a leaked privileged container
// fails the CLI instead of reporting success + exit 0.
let containerTeardownError: Error | undefined;View on GitHub (pinned to 0773b97458)
Solutions
- Re-run the resume; transient DB read failures may clear.
- Check logs for 'cli.workflow_hydrate_resume_failed' — the underlying error is included in the thrown message.
- If state is corrupted or schema-incompatible, start a fresh run instead of resuming.
- Align binary and database schema versions (update archon or follow database docs).
Defensive patterns
Strategy: try-catch
Validate before calling
// check the run has hydratable state before attempting resume
const prior = await store.getWorkflowRun(resumable.id);
if (!prior || (!prior.completedNodes?.length && !prior.interactiveLoopState)) {
throw new Error('Run has no resumable state; start a fresh run instead');
} Type guard
function isResumableState(s: unknown): s is { completedNodes: unknown[]; interactiveLoopState?: unknown } {
return typeof s === 'object' && s !== null && Array.isArray((s as { completedNodes?: unknown }).completedNodes);
} Try / catch
try {
prepared = await hydrateResume(resumable.id);
} catch (error) {
const err = error as Error;
getLog().error({ err, runId: resumable.id }, 'cli.workflow_hydrate_resume_failed');
throw new Error(`Cannot resume workflow '${workflowName}': failed to load prior run state — ${err.message}`);
} Prevention
- Upgrade archon and its schema together; avoid cross-version state sharing.
- Do not hand-edit the run-state database.
- Ensure adequate disk space so state writes are not truncated.
- Verify the target run has completed nodes (`workflow list --verbose`) before resuming.
When it happens
Trigger: `archon workflow <name> --resume` where hydrating the resumable run throws — corrupted or truncated run-state JSON, DB read failure, or schema drift between the version that wrote the state and the current binary.
Common situations: Database restored or moved leaving inconsistent run rows; upgrading archon across a schema change; disk-full during the original run left partial state; manual DB edits.
Related errors
- Cannot resume: the prior run for '${workflowName}' has no co
- workflow.parent_resume_no_working_path
- workflow.parent_resume_nothing_to_resume
- Failed to set up GitHub conversation - please try again
- --resume and --config are mutually exclusive. A resumed run
AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01).
Data as JSON: /api/errors/908f281ae0724632.
Report an issue: GitHub.