{"record":{"id":"85593b26392363d8","repo":"coleam00/Archon","slug":"detached-owner-process-stopped-but-the-isolation","errorCode":null,"errorMessage":"Detached owner process stopped, but the isolation container could not be confirmed stopped. Run state was not changed. ${(error as Error).message}","messagePattern":"Detached owner process stopped, but the isolation container could not be confirmed stopped\\. Run state was not changed\\. (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":4426,"sourceCode":"      }\n      containerEnvId = isolationEnvId;\n      const containerEnv = await isolationDb.getById(containerEnvId);\n      if (containerEnv?.provider !== 'container') {\n        throw new Error(\n          `Cannot confirm the isolation container owned by run ${resolvedId}. ` +\n            'The run was not changed; inspect the managed containers before retrying or abandoning it.'\n        );\n      }\n    }\n\n    const target = await requestDetachedRunStop(resolvedId);\n    await target.stop();\n\n    if (containerEnvId) {\n      try {\n        await reclaimContainerEnv(containerEnvId);\n      } catch (error) {\n        throw new Error(\n          'Detached owner process stopped, but the isolation container could not be confirmed stopped. ' +\n            `Run state was not changed. ${(error as Error).message}`\n        );\n      }\n    }\n\n    const { run, cancelled, cascadeFailures, blockedParentRunId } =\n      await abandonWorkflow(resolvedId);\n    if (!cancelled) {\n      const latest = await workflowDb.getWorkflowRun(resolvedId);\n      throw new Error(\n        'Detached work stopped, but cancellation did not win the run state transition. ' +\n          `The run status is ${latest?.status ?? 'unknown'}; it was not reported as cancelled.`\n      );\n    }\n    return {\n      resolvedId,\n      workflowName: run.workflow_name,","sourceCodeStart":4408,"sourceCodeEnd":4444,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L4408-L4444","documentation":"During active cancel, the detached owner process was stopped successfully but `reclaimContainerEnv` failed, so the CLI cannot confirm the isolation container is down. The run's state is intentionally NOT transitioned to cancelled — the operator gets a half-completed report rather than a silently orphaned container.","triggerScenarios":"Cancelling a container-isolated running run where the container runtime call fails: Docker/containerd daemon down, container already removed externally, timeout, or permission error during reclaim.","commonSituations":"Docker daemon not running or restarted; container was manually `docker rm`'d while the run was active; resource/permission issues in the container runtime; network/registry hiccup during teardown.","solutions":["Check the container runtime (`docker ps -a`) to see the container's actual state","Resolve the runtime issue (start the daemon, fix permissions), then retry the cancel","If the container is already gone, verify and reconcile the run state manually before forcing a cancel"],"exampleFix":"// before\nawait cancelWorkflow(runId); // half-stops, throws\n// after\ntry { await cancelWorkflow(runId); }\ncatch (e) { console.error('container reclaim failed:', (e as Error).message); /* check docker ps, retry */ }","handlingStrategy":"try-catch","validationCode":"// precheck the runtime before cancel\nawait exec('docker', ['info']); // fails fast if daemon is down","typeGuard":null,"tryCatchPattern":"try {\n  await cancelWorkflow(id);\n} catch (e) {\n  if (String(e).includes('isolation container could not be confirmed')) {\n    console.error('owner stopped but container state unknown; run docker ps -a and reconcile');\n  } else throw e;\n}","preventionTips":["Ensure the container daemon is healthy before cancelling container-isolated runs","Never docker rm a run's container by hand while its run is active","After this error, verify container state and run status manually before retrying"],"tags":["cli","workflow","cancel","container","docker"],"backgroundTag":"container-stop-failed","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}