{"record":{"id":"82ce85c7af6538c0","repo":"abhigyanpatwari/GitNexus","slug":"sandbox-copy-target-parent-has-an-unsupported-type-82ce85","errorCode":null,"errorMessage":"sandbox_copy target parent has an unsupported type: {parent}","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":736,"sourceCode":"            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}\")\n            if mode is not None and not stat.S_ISDIR(mode):\n                if not stat.S_ISREG(mode):\n                    raise SandboxError(f\"sandbox_copy target parent has an unsupported type: {parent}\")\n                os.unlink(part, dir_fd=current)\n                mode = None\n            if mode is None:\n                os.mkdir(part, mode=0o700, dir_fd=current)\n            next_descriptor = os.open(part, flags, dir_fd=current)\n            os.close(current)\n            current = next_descriptor\n        return current\n    except BaseException:\n        os.close(current)\n        raise\n\n\ndef _open_existing_parent(root: 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(root, flags)\n    try:\n        for part in parent.parts:","sourceCodeStart":718,"sourceCodeEnd":754,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/task_assets.py#L718-L754","documentation":"_open_publish_parent treats an intermediate component as replaceable only if it is a regular file (it unlinks the file and mkdirs in its place). Any other non-directory type (FIFO, socket, device) is rejected because the remover cannot safely delete it.","triggerScenarios":"A non-dir, non-regular-file entry sits at an intermediate parent path in the clone where the snapshot needs to create a directory.","commonSituations":"Stray IPC artifacts in the clone; a broken cleanup left a socket in a parent path; tooling created a special file before materialize.","solutions":["Locate: `find <clone> -xdev ! -type d ! -type f -print` and remove the entries","Reset the clone: `git -C <clone> clean -fdx`","Ensure no tool creates such entries before materialize runs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import os, stat\nfrom pathlib import Path\n\ndef non_replaceable_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)):\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\"non-replaceable special file in a parent path; reset the clone: {exc}\") from exc\n    raise","preventionTips":["`git clean -fdx` the clone before materialize","Detect with `find <clone> -xdev ! -type d ! -type f` and remove before publish"],"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"}