abhigyanpatwari/GitNexus · error · SandboxError

sandbox_copy target parent has an unsupported type: {relativ

Error message

sandbox_copy target parent has an unsupported type: {relative}

What it means

_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.

Source

Thrown at eval/workflow_bench/task_assets.py:715

    current = os.open(clone, flags)
    try:
        for index, part in enumerate(relative.parts):
            try:
                mode = os.stat(part, dir_fd=current, follow_symlinks=False).st_mode
            except FileNotFoundError:
                return
            last = index == len(relative.parts) - 1
            if stat.S_ISLNK(mode):
                role = "target cannot be a symlink" if last else "target has a symlink parent"
                raise SandboxError(f"sandbox_copy {role}: {relative}")
            if last:
                if not (stat.S_ISDIR(mode) or stat.S_ISREG(mode)):
                    raise SandboxError(f"sandbox_copy target has an unsupported type: {relative}")
                return
            if stat.S_ISREG(mode):
                return
            if not stat.S_ISDIR(mode):
                raise SandboxError(f"sandbox_copy target parent has an unsupported type: {relative}")
            next_descriptor = os.open(part, flags, dir_fd=current)
            os.close(current)
            current = next_descriptor
    finally:
        os.close(current)


def _open_publish_parent(clone: Path, parent: PurePosixPath) -> int:
    flags = os.O_RDONLY | os.O_DIRECTORY | getattr(os, "O_CLOEXEC", 0) | getattr(os, "O_NOFOLLOW", 0)
    current = os.open(clone, flags)
    try:
        for part in parent.parts:
            try:
                mode = os.stat(part, dir_fd=current, follow_symlinks=False).st_mode
            except FileNotFoundError:
                mode = None
            if mode is not None and stat.S_ISLNK(mode):
                raise SandboxError(f"sandbox_copy target cannot traverse a symlink: {parent}")

View on GitHub (pinned to d540b00184)

Solutions

  1. Locate it: `find <clone>/<root.parent> -xdev ! -type d ! -type f`
  2. Remove the offending entry and recreate the directory
  3. Reset the clone from a clean checkout
Defensive patterns

Strategy: validation

Validate before calling

import os, stat
from pathlib import Path

def special_in_parents(clone: Path, declarations: list[str]) -> list[str]:
    bad = []
    for decl in declarations:
        for parent in Path(decl).parents:
            p = clone / parent
            try:
                m = p.lstat().st_mode
            except FileNotFoundError:
                continue
            if not (stat.S_ISDIR(m) or stat.S_ISREG(m) or stat.S_ISLNK(m)):
                bad.append(str(p))
    return bad

Try / catch

from eval.workflow_bench.proposer_sandbox import SandboxError

try:
    snapshot.materialize(clone)
except SandboxError as exc:
    if "parent has an unsupported type" in str(exc):
        raise SystemExit(f"special file in a parent path; reset the clone: {exc}") from exc
    raise

Prevention

When it happens

Trigger: An intermediate directory in the clone was replaced by a FIFO, socket, or device node before materialize ran.

Common situations: Same special-file causes as 610 but on a parent path; rare and usually indicates a corrupted or hostile clone.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12). Data as JSON: /api/errors/aca8ef9caeb46ea0. Report an issue: GitHub.