{"record":{"id":"c3aeabb99bad477b","repo":"coleam00/Archon","slug":"workflow-run-not-found-resolvedid","errorCode":null,"errorMessage":"Workflow run not found: ${resolvedId}","messagePattern":"Workflow run not found: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":4393,"sourceCode":" *\n * Ordering is the contract: prove the live exact-run owner, terminate its process\n * tree, then record `cancelled`. An unreachable owner never falls back to a DB-only\n * transition — operators use `abandon` separately after verifying an orphan.\n */\nexport async function workflowCancelCommand(\n  runId: string,\n  json?: boolean,\n  cwd?: string\n): Promise<void> {\n  const cancel = async (): Promise<{\n    resolvedId: string;\n    workflowName: string;\n    cascadeFailures: number;\n    blockedParentRunId: string | null;\n  }> => {\n    const resolvedId = await resolveRunIdArg(runId, cwd);\n    const current = await workflowDb.getWorkflowRun(resolvedId);\n    if (!current) throw new Error(`Workflow run not found: ${resolvedId}`);\n    if (current.status !== 'running') {\n      throw new Error(\n        `Cannot actively cancel run with status '${current.status}'. Only a running detached CLI run has live work to stop.`\n      );\n    }\n\n    let containerEnvId: string | undefined;\n    if (current.metadata?.isolation === 'container') {\n      const isolationEnvId = current.metadata.isolation_env_id;\n      if (typeof isolationEnvId !== 'string' || isolationEnvId.trim().length === 0) {\n        throw new Error(\n          `Cannot confirm the isolation container owned by run ${resolvedId}. ` +\n            'The run was not changed; its container tracking ID is missing.'\n        );\n      }\n      containerEnvId = isolationEnvId;\n      const containerEnv = await isolationDb.getById(containerEnvId);\n      if (containerEnv?.provider !== 'container') {","sourceCodeStart":4375,"sourceCodeEnd":4411,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L4375-L4411","documentation":"Thrown by the active-cancel path when `workflowDb.getWorkflowRun(resolvedId)` cannot find a run matching the resolved ID. The CLI resolves partial IDs first; if nothing matches in the database, there is no run to cancel and it fails with this message.","triggerScenarios":"Calling `archon workflow cancel <id>` (detached/active cancel flow) with a mistyped or truncated ID, an ID from a different install/database, or a run that has been deleted.","commonSituations":"Copy-pasting a run ID from another machine or environment; using a stale ID after the DB was reset; typos or wrong prefix when passing a partial ID.","solutions":["Run `archon workflow list` (or `archon workflow runs`) and copy the exact current run ID","Confirm you are operating on the same Archon install/workspace/database that owns the run","Retry with the full run ID rather than a partial prefix"],"exampleFix":"// before\nawait cancelWorkflow('abc12');\n// after\nconst runs = await listWorkflowRuns();\nconst run = runs.find(r => r.id.startsWith('abc12'));\nif (!run) throw new Error(`no run matches abc12 — check 'archon workflow list'`);\nawait cancelWorkflow(run.id);","handlingStrategy":"validation","validationCode":"const run = await workflowDb.getWorkflowRun(id);\nif (!run) throw new Error(`run ${id} not found — check 'archon workflow list'`);","typeGuard":null,"tryCatchPattern":"try {\n  await cancelWorkflow(id);\n} catch (e) {\n  if (String(e).includes('not found')) console.error('bad run ID; list runs and retry');\n  else throw e;\n}","preventionTips":["Copy run IDs from `archon workflow list` on the same install","Use full IDs, not hand-truncated prefixes","Don't reference IDs from a reset or different database"],"tags":["cli","workflow","cancel","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}