abhigyanpatwari/GitNexus · error · SandboxError

sandbox_copy target has an unsupported type: {relative}

Error message

sandbox_copy target has an unsupported type: {relative}

What it means

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.

Source

Thrown at eval/workflow_bench/task_assets.py:710

def _preflight_exact_root(clone: Path, relative: PurePosixPath) -> None:
    """Reject symlink/special hazards while permitting replaceable type conflicts."""

    flags = os.O_RDONLY | os.O_DIRECTORY | getattr(os, "O_CLOEXEC", 0) | getattr(os, "O_NOFOLLOW", 0)
    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:

View on GitHub (pinned to d540b00184)

Solutions

  1. Locate the special file: `find <clone>/<root> -xdev ! -type d ! -type f -print`
  2. Remove it and reset the clone: `git -C <clone> clean -fdx`
  3. Identify the tool that created it and prevent it from running before materialization
Defensive patterns

Strategy: validation

Validate before calling

import os, stat
from pathlib import Path

def special_at_roots(clone: Path, declarations: list[str]) -> list[str]:
    bad = []
    for decl in declarations:
        p = clone / decl
        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 "target has an unsupported type" in str(exc):
        raise SystemExit(f"special file at declared root; remove it: {exc}") from exc
    raise

Prevention

When it happens

Trigger: 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.

Common situations: Leftover IPC artifacts in a reused clone; tooling that creates sockets before materialize runs.

Related errors


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