{"record":{"id":"7c0c9dbcd94f517f","repo":"abhigyanpatwari/GitNexus","slug":"sandbox-copy-target-has-an-unsupported-type-rela","errorCode":null,"errorMessage":"sandbox_copy target has an unsupported type: {relative}","messagePattern":"sandbox_copy target has an unsupported type: (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/task_assets.py","lineNumber":710,"sourceCode":"\ndef _preflight_exact_root(clone: Path, relative: PurePosixPath) -> None:\n    \"\"\"Reject symlink/special hazards while permitting replaceable type conflicts.\"\"\"\n\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 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:","sourceCodeStart":692,"sourceCodeEnd":728,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/task_assets.py#L692-L728","documentation":"In _preflight_exact_root, the final component of the destination path exists but is neither a directory nor a regular file (FIFO, socket, device). The publish/rename step only replaces dirs and regular files, so any other type at the leaf aborts preflight.","triggerScenarios":"A stale special file left in the clone at the declared root; an editor or build tool created a socket or named pipe at that location.","commonSituations":"Leftover IPC artifacts in a reused clone; tooling that creates sockets before materialize runs.","solutions":["Locate the special file: `find <clone>/<root> -xdev ! -type d ! -type f -print`","Remove it and reset the clone: `git -C <clone> clean -fdx`","Identify the tool that created it and prevent it from running before materialization"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import os, stat\nfrom pathlib import Path\n\ndef special_at_roots(clone: Path, declarations: list[str]) -> list[str]:\n    bad = []\n    for decl in declarations:\n        p = clone / decl\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 \"target has an unsupported type\" in str(exc):\n        raise SystemExit(f\"special file at declared root; remove it: {exc}\") from exc\n    raise","preventionTips":["`git clean -fdx` the clone before materialize to remove stray special files","Find them ahead of time: `find <clone>/<root> ! -type d ! -type f`","Stop any tool that creates sockets/FIFOs in the clone before materialize"],"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"}