{"record":{"id":"5953a15da0dc1fa6","repo":"agentscope-ai/agentscope","slug":"left-name-must-not-overlap-right-name","errorCode":null,"errorMessage":"{left_name} must not overlap {right_name}.","messagePattern":"(.+?) must not overlap (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/agentscope/workspace/_bubblewrap/_bubblewrap_backend.py","lineNumber":100,"sourceCode":"        )\n        mount_sources: list[tuple[str, str]] = [\n            (\"host_workdir\", self._host_workdir),\n            (\"host_tmpdir\", self._host_tmpdir),\n        ]\n        self._host_cache_dir: str | None = None\n        self._host_cache_identity: tuple[int, int] | None = None\n        cache_dir: str | None = None\n        if host_cache_dir is not None:\n            cache_dir = os.path.abspath(host_cache_dir)\n            if os.path.lexists(cache_dir) and os.path.islink(cache_dir):\n                raise ValueError(\"host_cache_dir must not be a symbolic link.\")\n            cache_realpath = os.path.realpath(cache_dir)\n            self._host_cache_dir = cache_realpath\n            mount_sources.append((\"host_cache_dir\", cache_realpath))\n        for index, (left_name, left_path) in enumerate(mount_sources):\n            for right_name, right_path in mount_sources[index + 1 :]:\n                if self._paths_overlap(left_path, right_path):\n                    raise ValueError(\n                        f\"{left_name} must not overlap {right_name}.\",\n                    )\n        if cache_dir is not None:\n            cache_created = not os.path.lexists(cache_dir)\n            os.makedirs(cache_dir, mode=0o700, exist_ok=True)\n            if cache_created:\n                os.chmod(cache_dir, 0o700)\n            if not os.path.isdir(cache_dir):\n                raise ValueError(\"host_cache_dir must be a directory.\")\n            assert self._host_cache_dir is not None\n            self._host_cache_identity = self._directory_identity(\n                self._host_cache_dir,\n                label=\"host_cache_dir\",\n            )\n        self._workdir = workdir\n        self._share_net = share_net\n        self._env = dict(env or {})\n","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/agentscope-ai/agentscope/blob/e90f1c7592896cc95f6e5ee506194f533378247d/src/agentscope/workspace/_bubblewrap/_bubblewrap_backend.py#L82-L118","documentation":"Raised by BubblewrapBackend.__init__ when two configured host mount sources (e.g. host_workdir, host_tmpdir, host_cache_dir) resolve to overlapping real paths. Because each directory is bind-mounted separately into the bwrap sandbox, nested mounts would conflict, so the constructor rejects them up front.","triggerScenarios":"Passing host_cache_dir that is equal to, a parent of, or a child of host_workdir or host_tmpdir; any pair of mount source directories whose realpath contains the other.","commonSituations":"Setting cache_dir inside the workspace directory, reusing the same temp dir for workdir and cache, or pointing multiple config options at ~/project.","solutions":["Point each of host_workdir, host_tmpdir, and host_cache_dir at disjoint directories (e.g. /data/ws and /var/cache/ws)","If you want one shared tree, drop the redundant option (set cache_dir=None) instead of nesting it","Check with os.path.realpath before constructing that no path is a prefix of another"],"exampleFix":"# before\nws = BubblewrapWorkspace(host_workdir='/data/app', host_cache_dir='/data/app/cache')\n# after\nws = BubblewrapWorkspace(host_workdir='/data/app', host_cache_dir='/var/cache/app')","handlingStrategy":"validation","validationCode":"import os\nreal = {name: os.path.realpath(p) for name, p in [('workdir', wd), ('tmpdir', td), ('cache', cd)] if p}\npaths = list(real.values())\nfor i, a in enumerate(paths):\n    for b in paths[i+1:]:\n        assert not (a == b or a.startswith(b + os.sep) or b.startswith(a + os.sep)), 'overlapping mounts'","typeGuard":"null","tryCatchPattern":"try:\n    backend = BubblewrapBackend(...)\nexcept ValueError as e:\n    if 'must not overlap' in str(e):\n        # pick disjoint directories and retry","preventionTips":["Keep workspace, tmp, and cache roots on separate top-level paths","Never place host_cache_dir under host_workdir"],"tags":["bubblewrap","sandbox","filesystem","config"],"backgroundTag":"overlapping-mount-paths","analyzedSha":"e90f1c7592896cc95f6e5ee506194f533378247d","analyzedAt":"2026-08-28T18:24:12.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}