{"record":{"id":"aca8ef9caeb46ea0","repo":"abhigyanpatwari/GitNexus","slug":"sandbox-copy-target-parent-has-an-unsupported-type","errorCode":null,"errorMessage":"sandbox_copy target parent has an unsupported type: {relative}","messagePattern":"sandbox_copy target parent has an unsupported type: (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/task_assets.py","lineNumber":715,"sourceCode":"    current = os.open(clone, flags)\n    try:\n        for index, part in enumerate(relative.parts):\n            try:\n                mode = os.stat(part, dir_fd=current, follow_symlinks=False).st_mode\n            except FileNotFoundError:\n                return\n            last = index == len(relative.parts) - 1\n            if stat.S_ISLNK(mode):\n                role = \"target cannot be a symlink\" if last else \"target has a symlink parent\"\n                raise SandboxError(f\"sandbox_copy {role}: {relative}\")\n            if last:\n                if not (stat.S_ISDIR(mode) or stat.S_ISREG(mode)):\n                    raise SandboxError(f\"sandbox_copy target has an unsupported type: {relative}\")\n                return\n            if stat.S_ISREG(mode):\n                return\n            if not stat.S_ISDIR(mode):\n                raise SandboxError(f\"sandbox_copy target parent has an unsupported type: {relative}\")\n            next_descriptor = os.open(part, flags, dir_fd=current)\n            os.close(current)\n            current = next_descriptor\n    finally:\n        os.close(current)\n\n\ndef _open_publish_parent(clone: Path, parent: PurePosixPath) -> int:\n    flags = os.O_RDONLY | os.O_DIRECTORY | getattr(os, \"O_CLOEXEC\", 0) | getattr(os, \"O_NOFOLLOW\", 0)\n    current = os.open(clone, flags)\n    try:\n        for part in parent.parts:\n            try:\n                mode = os.stat(part, dir_fd=current, follow_symlinks=False).st_mode\n            except FileNotFoundError:\n                mode = None\n            if mode is not None and stat.S_ISLNK(mode):\n                raise SandboxError(f\"sandbox_copy target cannot traverse a symlink: {parent}\")","sourceCodeStart":697,"sourceCodeEnd":733,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/task_assets.py#L697-L733","documentation":"_preflight_exact_root rejects an intermediate parent component that is neither dir, regular file, nor symlink (symlinks are handled by the earlier check). The traversal cannot descend through a special file to reach deeper parts of the declared root.","triggerScenarios":"An intermediate directory in the clone was replaced by a FIFO, socket, or device node before materialize ran.","commonSituations":"Same special-file causes as 610 but on a parent path; rare and usually indicates a corrupted or hostile clone.","solutions":["Locate it: `find <clone>/<root.parent> -xdev ! -type d ! -type f`","Remove the offending entry and recreate the directory","Reset the clone from a clean checkout"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import os, stat\nfrom pathlib import Path\n\ndef special_in_parents(clone: Path, declarations: list[str]) -> list[str]:\n    bad = []\n    for decl in declarations:\n        for parent in Path(decl).parents:\n            p = clone / parent\n            try:\n                m = p.lstat().st_mode\n            except FileNotFoundError:\n                continue\n            if not (stat.S_ISDIR(m) or stat.S_ISREG(m) or stat.S_ISLNK(m)):\n                bad.append(str(p))\n    return bad","typeGuard":null,"tryCatchPattern":"from eval.workflow_bench.proposer_sandbox import SandboxError\n\ntry:\n    snapshot.materialize(clone)\nexcept SandboxError as exc:\n    if \"parent has an unsupported type\" in str(exc):\n        raise SystemExit(f\"special file in a parent path; reset the clone: {exc}\") from exc\n    raise","preventionTips":["Reset the clone with `git clean -fdx` before materialize","Avoid creating IPC artifacts in directories that are parents of declared roots"],"tags":["sandbox","sandbox-copy","special-files","clone-hygiene"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}