{"record":{"id":"cbf9847fd12ccffc","repo":"FoundationAgents/OpenManus","slug":"failed-to-ensure-docker-image-config-image","errorCode":null,"errorMessage":"Failed to ensure Docker image: {config.image}","messagePattern":"Failed to ensure Docker image: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"app/sandbox/core/manager.py","lineNumber":139,"sourceCode":"        Args:\n            config: Sandbox configuration.\n            volume_bindings: Volume mapping configuration.\n\n        Returns:\n            str: Sandbox ID.\n\n        Raises:\n            RuntimeError: If max sandbox count reached or creation fails.\n        \"\"\"\n        async with self._global_lock:\n            if len(self._sandboxes) >= self.max_sandboxes:\n                raise RuntimeError(\n                    f\"Maximum number of sandboxes ({self.max_sandboxes}) reached\"\n                )\n\n            config = config or SandboxSettings()\n            if not await self.ensure_image(config.image):\n                raise RuntimeError(f\"Failed to ensure Docker image: {config.image}\")\n\n            sandbox_id = str(uuid.uuid4())\n            try:\n                sandbox = DockerSandbox(config, volume_bindings)\n                await sandbox.create()\n\n                self._sandboxes[sandbox_id] = sandbox\n                self._last_used[sandbox_id] = asyncio.get_event_loop().time()\n                self._locks[sandbox_id] = asyncio.Lock()\n\n                logger.info(f\"Created sandbox {sandbox_id}\")\n                return sandbox_id\n\n            except Exception as e:\n                logger.error(f\"Failed to create sandbox: {e}\")\n                if sandbox_id in self._sandboxes:\n                    await self.delete_sandbox(sandbox_id)\n                raise RuntimeError(f\"Failed to create sandbox: {e}\")","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/sandbox/core/manager.py#L121-L157","documentation":"Raised by SandboxManager.create_sandbox (app/sandbox/core/manager.py:139) when self.ensure_image(config.image) returns False, meaning the manager could not confirm the image exists locally or pull/build it. Nothing container-related has started yet — the failure is purely image availability: bad tag, registry unreachable, missing registry credentials, or a Docker daemon problem.","triggerScenarios":"config.image names a tag that does not exist in the local cache or the registry (typo, missing prefix like 'library/'); Docker daemon is stopped or unreachable; private registry requires auth that is not configured; rate-limited pulls from Docker Hub.","commonSituations":"Air-gapped or proxied environments where docker pull fails; CI runners with a cold cache and Hub rate limits; a custom image that was renamed but SandboxSettings defaults were not updated; rootless Docker socket permission issues.","solutions":["Run `docker pull <config.image>` manually on the host to see the real underlying error.","Verify the image tag spelling and registry prefix (e.g. docker.io/library/python:3.11-slim).","Pre-build/pre-pull the image on the host so ensure_image finds it in the local cache.","Check the Docker daemon is running and the user has permission on /var/run/docker.sock; configure registry credentials for private images."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import docker\nclient = docker.from_env()\ntry:\n    client.images.get(config.image)\nexcept docker.errors.ImageNotFound:\n    client.images.pull(config.image)  # fail here with the real registry error","typeGuard":null,"tryCatchPattern":"try:\n    sid = await manager.create_sandbox(config)\nexcept RuntimeError as e:\n    if \"Failed to ensure Docker image\" in str(e):\n        log.error(\"image %s unavailable — check registry/daemon\", config.image); raise","preventionTips":["Pre-pull sandbox images during deployment","Pin exact image tags that exist in your registry","Verify `docker info` works as the service user before starting the app","Configure registry auth for private images on the host"],"tags":["docker","image","registry","pull","environment"],"backgroundTag":null,"analyzedSha":"52a13f2a57d8c7f6737eefb02ccf569594d44273","analyzedAt":"2026-08-15T02:33:49.993Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}