{"record":{"id":"47960194aaee7784","repo":"agentscope-ai/agentscope","slug":"failed-to-pull-image-self-base-image-r-stderr","errorCode":null,"errorMessage":"Failed to pull image {self.base_image!r}: {stderr.decode(errors='replace')}","messagePattern":"Failed to pull image (.+?): (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/agentscope/workspace/_applecontainer/_applecontainer_workspace.py","lineNumber":354,"sourceCode":"                        )\n                        return\n\n        # Pull the image.\n        logger.info(\n            \"AppleContainerWorkspace: pulling image %r ...\",\n            self.base_image,\n        )\n        process = await asyncio.create_subprocess_exec(\n            \"container\",\n            \"image\",\n            \"pull\",\n            self.base_image,\n            stdout=asyncio.subprocess.PIPE,\n            stderr=asyncio.subprocess.PIPE,\n        )\n        _, stderr = await process.communicate()\n        if process.returncode != 0:\n            raise RuntimeError(\n                f\"Failed to pull image {self.base_image!r}: \"\n                f\"{stderr.decode(errors='replace')}\",\n            )\n        logger.info(\n            \"AppleContainerWorkspace: image %r pulled successfully\",\n            self.base_image,\n        )\n\n    # ── internals: container lifecycle ──────────────────────────\n\n    async def _find_existing_container(self) -> str | None:\n        \"\"\"Find a container by name via ``container list --format json``.\n\n        Returns:\n            `str | None`:\n                The container ID if found, ``None`` otherwise.\n        \"\"\"\n        process = await asyncio.create_subprocess_exec(","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/agentscope-ai/agentscope/blob/e90f1c7592896cc95f6e5ee506194f533378247d/src/agentscope/workspace/_applecontainer/_applecontainer_workspace.py#L336-L372","documentation":"During provisioning, _pull_image_if_needed runs `container image pull <base_image>`; a non-zero exit raises RuntimeError with the pull stderr. The base image could not be fetched into the local image store.","triggerScenarios":"Creating AppleContainerWorkspace with a base_image that doesn't exist in the registry (typo, wrong tag), registry unreachable, authentication required for a private image, or disk-full preventing the pull.","commonSituations":"Typos like 'ubunutu:24.04' or nonexistent tags (e.g. 'python:3.99'), air-gapped environments blocking registry access, private registry images without prior `container login`, or low disk space.","solutions":["Verify the image name/tag exists: docker manifest inspect <image> or check the registry page.","Use a known-good tag, e.g. 'ubuntu:24.04' or 'python:3.12-slim'.","For private registries, authenticate first (container login / credential helper).","Check network access to the registry and available disk space; read stderr in the message."],"exampleFix":"# before\nws = AppleContainerWorkspace(base_image=\"ubunutu:24.04\")\n\n# after\nws = AppleContainerWorkspace(base_image=\"ubuntu:24.04\")","handlingStrategy":"validation","validationCode":"# pre-verify the tag resolves before provisioning\nimport subprocess\nr = subprocess.run([\"container\", \"image\", \"pull\", base_image], capture_output=True)\nassert r.returncode == 0, f\"bad base_image: {base_image}\"","typeGuard":null,"tryCatchPattern":"try:\n    ws = await AppleContainerWorkspace.create(base_image=tag)\nexcept RuntimeError as e:\n    if \"Failed to pull image\" in str(e):\n        ws = await AppleContainerWorkspace.create(base_image=\"ubuntu:24.04\")\n    else:\n        raise","preventionTips":["Pin base_image to a known-existing tag (ubuntu:24.04, python:3.12-slim).","Authenticate to private registries before provisioning.","Keep disk space free for image pulls."],"tags":["applecontainer","workspace","image-pull","container-registry","provisioning"],"backgroundTag":"image-pull-failed","analyzedSha":"e90f1c7592896cc95f6e5ee506194f533378247d","analyzedAt":"2026-08-28T18:24:12.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}