{"record":{"id":"9d65d81d539dacb7","repo":"coleam00/Archon","slug":"failed-to-inspect-container-nameorid-detai","errorCode":null,"errorMessage":"Failed to inspect container '${nameOrId}': ${detail}","messagePattern":"Failed to inspect container '(.+?)': (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/isolation/src/backends/container.ts","lineNumber":499,"sourceCode":"    overlayMode: OverlayMode\n  ): PreparedEnv {\n    return { cwd, execContext: { kind: 'container', containerId }, envId, overlayMode };\n  }\n\n  /**\n   * Container presence as three outcomes: `running`, `stopped` (exists but not\n   * running), or `missing` (no such container). Distinct from {@link containerState}\n   * which folds \"missing\" and \"inspect blip\" into `unknown` — resume MUST tell\n   * \"gone\" (→ recreate over the volume) apart from \"stopped\" (→ start).\n   */\n  private async describeContainer(nameOrId: string): Promise<'running' | 'stopped' | 'missing'> {\n    try {\n      const { stdout } = await this.docker(['inspect', '-f', '{{.State.Running}}', nameOrId]);\n      return stdout.trim() === 'true' ? 'running' : 'stopped';\n    } catch (err) {\n      const detail = extractDockerError(err);\n      if (/no such (object|container)/i.test(detail)) return 'missing';\n      throw new Error(`Failed to inspect container '${nameOrId}': ${detail}`);\n    }\n  }\n\n  private async getContainerId(nameOrId: string): Promise<string> {\n    const { stdout } = await this.docker(['inspect', '-f', '{{.Id}}', nameOrId]);\n    return stdout.trim();\n  }\n\n  private async volumeExists(volume: string): Promise<boolean> {\n    try {\n      await this.docker(['volume', 'inspect', volume]);\n      return true;\n    } catch (err) {\n      const detail = extractDockerError(err);\n      if (/no such volume/i.test(detail)) return false;\n      throw new Error(`Failed to inspect volume '${volume}': ${detail}`);\n    }\n  }","sourceCodeStart":481,"sourceCodeEnd":517,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/isolation/src/backends/container.ts#L481-L517","documentation":"presence() runs `docker inspect -f {{.State.Running}}` and distinguishes 'running'/'stopped'/'missing'. A 'no such object/container' error is treated as 'missing', but any other docker inspect failure is unexpected and rethrown wrapped in this message.","triggerScenarios":"`docker inspect` fails with an error other than 'no such object' — e.g. daemon unreachable mid-call, permission denied on the socket, malformed name string, or daemon timeout.","commonSituations":"Docker daemon restarted or crashed between calls; user not in the docker group; stale DOCKER_HOST/DOCKER_CONTEXT pointing at an unreachable daemon; a container name with invalid characters from config.","solutions":["Run `docker inspect <name>` manually to see the raw error","Check Docker daemon health (`docker info`) and DOCKER_HOST/DOCKER_CONTEXT settings","Verify socket permissions (add user to docker group or adjust socket access)","Retry once transient errors are resolved"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const { execSync } = require('child_process');\ntry { execSync('docker info', { stdio: 'ignore' }); } catch { throw new Error('Docker daemon not reachable'); }","typeGuard":null,"tryCatchPattern":"try {\n  const state = await backend.presence(nameOrId);\n} catch (err) {\n  if (String(err).startsWith('Failed to inspect container')) {\n    // daemon-level problem, not a missing container — log and stop\n  }\n  throw err;\n}","preventionTips":["Check `docker info` health before batch container operations","Keep DOCKER_HOST/DOCKER_CONTEXT stable during a run","Ensure the user has docker group / socket access"],"tags":["docker","inspect","daemon"],"backgroundTag":"docker-inspect-failed","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}