{"record":{"id":"424a870e602fa804","repo":"coleam00/Archon","slug":"invalid-container-pidslimit-string-pidslimit","errorCode":null,"errorMessage":"Invalid container.pidsLimit '${String(pidsLimit)}' — must be a positive integer.","messagePattern":"Invalid container\\.pidsLimit '(.+?)' — must be a positive integer\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":405,"sourceCode":"): ContainerBackendConfig {\n  const network = cfg?.network;\n  if (network !== undefined && network !== 'bridge' && network !== 'none') {\n    throw new Error(\n      `Invalid container.network '${network}' in .archon/config.yaml — must be ` +\n        \"'bridge' or 'none'. Host networking is not allowed for container isolation.\"\n    );\n  }\n  // Positive INTEGERS — `docker run --memory`/`--pids-limit` reject fractions,\n  // and Number.isFinite alone would let `512.5` through to a runtime docker error.\n  const memoryMb = cfg?.memoryMb;\n  if (memoryMb !== undefined && (!Number.isInteger(memoryMb) || memoryMb <= 0)) {\n    throw new Error(\n      `Invalid container.memoryMb '${String(memoryMb)}' — must be a positive integer (MiB).`\n    );\n  }\n  const pidsLimit = cfg?.pidsLimit;\n  if (pidsLimit !== undefined && (!Number.isInteger(pidsLimit) || pidsLimit <= 0)) {\n    throw new Error(\n      `Invalid container.pidsLimit '${String(pidsLimit)}' — must be a positive integer.`\n    );\n  }\n  return {\n    image: cfg?.image?.trim() || DEFAULT_RUNNER_IMAGE,\n    network: network ?? 'bridge',\n    memoryMb: memoryMb ?? 4096,\n    pidsLimit: pidsLimit ?? 512,\n  };\n}\n\n/**\n * H2 — a container run has an UNRESOLVED write-back when its overlay diff was raised\n * for review (`pending_writeback` set) but never applied or discarded\n * (`writeback_resolved !== true`). This happens on a failed/partial apply. The CLI\n * teardown must PRESERVE the container+volume in this state (the overlay is the only\n * copy of the changes) rather than destroy it. Pure so the decision is unit-testable.\n */","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L387-L423","documentation":"resolveContainerBackendConfig() requires container.pidsLimit to be a positive integer when present. `docker run --pids-limit` rejects fractional and non-positive values, so the CLI enforces Number.isInteger and > 0 and throws this error before any docker call is made.","triggerScenarios":"container.pidsLimit in .archon/config.yaml is a float (e.g. 100.5), zero, negative, or a non-numeric value (string 'auto', null, YAML boolean) when resolveContainerBackendConfig runs during workflow start.","commonSituations":"Setting pidsLimit: 0 believing it means 'unlimited' (it must be positive; remove the key instead); copying a float; leaving a placeholder string from a template.","solutions":["Set `container.pidsLimit` to a positive integer, e.g. `pidsLimit: 256`.","Remove the `pidsLimit` key entirely if you do not want a limit.","Validate your YAML types — unquoted values must parse as numbers, not strings."],"exampleFix":"// .archon/config.yaml (before)\ncontainer:\n  pidsLimit: 0\n// after\ncontainer:\n  pidsLimit: 256","handlingStrategy":"validation","validationCode":"const p = cfg?.container?.pidsLimit;\nif (p !== undefined && (!Number.isInteger(p) || p <= 0)) {\n  throw new Error(`container.pidsLimit must be a positive integer, got: ${String(p)}`);\n}","typeGuard":"function isPositiveInteger(v: unknown): v is number {\n  return typeof v === 'number' && Number.isInteger(v) && v > 0;\n}","tryCatchPattern":"try {\n  await runWorkflow(name, opts);\n} catch (e) {\n  if (String((e as Error).message).includes('Invalid container.pidsLimit')) {\n    console.error('Set container.pidsLimit to a positive integer or remove the key.');\n  }\n}","preventionTips":["Do not use 0 to mean unlimited — omit the key instead.","Keep pidsLimit a whole number (docker --pids-limit rejects fractions).","Check YAML types: unquoted placeholders like 'auto' stay strings and will fail."],"tags":["configuration","validation","docker","container"],"backgroundTag":"invalid-config-value","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}