{"record":{"id":"b99576a151c6a2b0","repo":"agentscope-ai/agentscope","slug":"apple-container-cli-is-not-available-ensure-it-is","errorCode":null,"errorMessage":"Apple Container CLI is not available. Ensure it is installed and running: `container system start`.\\nstderr: {stderr.decode(errors='replace')}","messagePattern":"Apple Container CLI is not available\\. Ensure it is installed and running: `container system start`\\.\\\\nstderr: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"src/agentscope/workspace/_applecontainer/_applecontainer_workspace.py","lineNumber":264,"sourceCode":"        try:\n            process = await asyncio.create_subprocess_exec(\n                \"container\",\n                \"system\",\n                \"version\",\n                \"--format\",\n                \"json\",\n                stdout=asyncio.subprocess.PIPE,\n                stderr=asyncio.subprocess.PIPE,\n            )\n            stdout, stderr = await process.communicate()\n        except FileNotFoundError as e:\n            # The ``container`` binary itself is missing.\n            raise RuntimeError(\n                \"Apple Container CLI is not installed. Install it \"\n                \"first: https://github.com/apple/container\",\n            ) from e\n        if process.returncode != 0:\n            raise RuntimeError(\n                \"Apple Container CLI is not available. \"\n                \"Ensure it is installed and running: \"\n                \"`container system start`.\\n\"\n                f\"stderr: {stderr.decode(errors='replace')}\",\n            )\n        logger.info(\n            \"AppleContainerWorkspace: CLI OK — %s\",\n            stdout.decode(errors=\"replace\").strip(),\n        )\n\n    # ── internals: image management ─────────────────────────────\n\n    @staticmethod\n    def _normalize_image_ref(ref: str) -> str:\n        \"\"\"Normalize an OCI image reference for comparison.\n\n        Strips the default registry (``docker.io``) and the default\n        namespace (``library``) so that short references like","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/agentscope-ai/agentscope/blob/e90f1c7592896cc95f6e5ee506194f533378247d/src/agentscope/workspace/_applecontainer/_applecontainer_workspace.py#L246-L282","documentation":"_check_cli found the `container` binary but invoking it returned a non-zero exit code, meaning the CLI is installed but its backing service/daemon isn't running. The error suggests `container system start` and includes stderr.","triggerScenarios":"Creating an AppleContainerWorkspace when the container service is stopped, needs root/privilege, first-run setup incomplete, or macOS virtualization framework errors. Raised from _check_cli during provisioning.","commonSituations":"After macOS reboot before starting the service, service crashed, macOS version lacking/incomplete Virtualization framework support, or missing permissions for the daemon.","solutions":["Run: container system start (may require sudo).","Check service status: container system info; read stderr embedded in the error.","Update the CLI and macOS to versions that satisfy apple/container requirements.","If the service won't start, check Virtualization Framework support and free disk space."],"exampleFix":"# shell\n# before: error on workspace creation\ncontainer system start\n# then retry creating AppleContainerWorkspace","handlingStrategy":"validation","validationCode":"import subprocess\nr = subprocess.run([\"container\", \"system\", \"info\"], capture_output=True)\nassert r.returncode == 0, \"start service: container system start\"","typeGuard":null,"tryCatchPattern":"try:\n    ws = await AppleContainerWorkspace.create(base_image=\"ubuntu:24.04\")\nexcept RuntimeError as e:\n    if \"not available\" in str(e):\n        subprocess.run([\"container\", \"system\", \"start\"], check=True)\n        ws = await AppleContainerWorkspace.create(base_image=\"ubuntu:24.04\")\n    else:\n        raise","preventionTips":["Run `container system start` during environment provisioning.","Check service health before creating workspaces in long-lived apps."],"tags":["applecontainer","workspace","service-down","cli","macos"],"backgroundTag":"service-not-running","analyzedSha":"e90f1c7592896cc95f6e5ee506194f533378247d","analyzedAt":"2026-08-28T18:24:12.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}