{"record":{"id":"4a57bf9364d754c2","repo":"coleam00/Archon","slug":"classifyisolationerror-err","errorCode":null,"errorMessage":"classifyIsolationError(err)","messagePattern":"classifyIsolationError\\(err\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":2534,"sourceCode":"            ? resumable.metadata.isolation_env_id\n            : undefined;\n        if (!resumeEnvId) {\n          throw new Error(\n            `Cannot resume container run '${resumable?.id ?? '?'}': its isolation env id is ` +\n              'missing from the run metadata. Start a fresh --container run instead.'\n          );\n        }\n        console.log(`Folder project — resuming container run (image ${containerConfig.image}).`);\n        getLog().info(\n          { envId: resumeEnvId, image: containerConfig.image },\n          'workflow.resuming_in_container'\n        );\n        try {\n          prepared = await backend.resumeEnv(resumeEnvId);\n        } catch (resumeErr) {\n          const err = resumeErr as Error;\n          getLog().error({ err, envId: resumeEnvId }, 'workflow.container_resume_failed');\n          throw new Error(classifyIsolationError(err));\n        }\n      } else {\n        console.log(`Folder project — running in container (image ${containerConfig.image}).`);\n        getLog().info(\n          { cwd: codebase.default_cwd, image: containerConfig.image },\n          'workflow.running_in_container'\n        );\n        try {\n          // The container fixes its mounts at creation, so the run's source must already\n          // be at its final path. Move it there now; executeWorkflow recomputes the same\n          // destination and skips its own move.\n          if (preparedSource) {\n            preparedSource = await finalizeWorkflowSource(createWorkflowDeps(), preparedSource, {\n              cwd: folderCodebase.defaultCwd,\n              codebaseId: folderCodebase.id,\n            });\n            // Finalization moved the capture, so keep ownership on the path that now\n            // exists. If container preparation fails below, the wrap reclaims the","sourceCodeStart":2516,"sourceCodeEnd":2552,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L2516-L2552","documentation":"When resuming a detached workflow run that used a container isolation environment, `backend.resumeEnv(resumeEnvId)` can fail; the CLI wraps the failure via `classifyIsolationError(err)` (packages/isolation/src/errors.ts:160), which pattern-matches message/stderr into an actionable message (daemon down, image missing, docker-group permissions) or a generic 'Could not create isolated workspace' fallback.","triggerScenarios":"Running `archon workflow <name>` for a resumable run whose isolation env is container-based and `resumeEnv` throws: docker daemon not running, container/image removed, docker socket permission denied, or a stale/unrecoverable env record.","commonSituations":"Docker Desktop was stopped or upgraded between the original run and the resume; the runner image was pruned with `docker image prune -a`; the user is not in the `docker` group on Linux; a reboot removed the container the env pointed to.","solutions":["Start the Docker daemon and verify with `docker info`, then re-run the resume command.","Check `docker images` for the configured runner image; rebuild/pull it if pruned.","Add your user to the docker group (`sudo usermod -aG docker $USER`) and re-login, or fix DOCKER_HOST permissions.","If the env is unrecoverable, delete the stale isolation env record and start a fresh run instead of resuming."],"exampleFix":"// before\nthrow new Error(classifyIsolationError(err));\n// after\ngetLog().error({ err }, 'workflow.container_resume_failed');\nthrow new Error(`${classifyIsolationError(err)}\\n(Original error: ${err.message})`);","handlingStrategy":"try-catch","validationCode":"// preflight before containerized resume\nconst docker = Bun.$`docker info`.nothrow().quiet();\nif (docker.exitCode !== 0) throw new Error('Docker daemon not reachable; start Docker before resuming');","typeGuard":"function isIsolationError(e: unknown): e is Error & { stderr?: string } {\n  return e instanceof Error && ('stderr' in e ? typeof (e as { stderr?: unknown }).stderr === 'string' || (e as { stderr?: unknown }).stderr === undefined : true);\n}","tryCatchPattern":"try {\n  prepared = await backend.resumeEnv(resumeEnvId);\n} catch (err) {\n  const e = err as Error;\n  if (!isKnownIsolationError(e)) throw e; // surface unknown bugs\n  console.error(classifyIsolationError(e));\n  process.exitCode = 1;\n}","preventionTips":["Run `docker info` as a preflight before containerized resumes.","Keep the runner image pinned; avoid aggressive `docker image prune -a`.","Ensure the invoking user has docker socket access (docker group / DOCKER_HOST).","Prefer worktree isolation when Docker availability is uncertain."],"tags":["docker","isolation","resume"],"backgroundTag":"docker-daemon-unavailable","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}