abhigyanpatwari/GitNexus · error · RuntimeError

task asset snapshot preparation failed: {asset_snapshot_erro

Error message

task asset snapshot preparation failed: {asset_snapshot_error}

What it means

Raised inside the per-arm run loop: an earlier attempt to prepare the task asset snapshot failed (OSError/SandboxError/ValueError) and the stored exception was captured in asset_snapshot_error; on the next arm iteration the loop re-raises it wrapped as a RuntimeError so the failure is reported with context rather than silently skipped. Asset snapshot preparation materializes the immutable dependency bundle the sandbox mounts.

Source

Thrown at eval/workflow_bench/runner.py:1066

                        runtime_mounts=runtime_mounts,
                    )
                    graph_snapshots[graph_key] = graph_snapshot
            except (ManagedProcessError, OSError, SandboxError, RuntimeError, ValueError) as exc:
                graph_snapshot_error = exc
                graph_snapshot_errors[graph_key] = exc
            per_arm: dict[str, list[dict[str, Any]]] = {a: [] for a in args.arms}
            for run_idx in range(args.runs):
                if outage_tripped:
                    break
                for arm in args.arms:
                    if outage_tripped:
                        break
                    worktree: Path | None = None
                    record: dict[str, Any] | None = None
                    cleanup_error: OSError | None = None
                    try:
                        if asset_snapshot_error is not None:
                            raise RuntimeError(f"task asset snapshot preparation failed: {asset_snapshot_error}")
                        if graph_snapshot_error is not None:
                            raise RuntimeError(f"sanitized graph snapshot preparation failed: {graph_snapshot_error}")
                        if graph_snapshot is None:
                            raise RuntimeError("sanitized graph snapshot is unavailable")
                        if asset_snapshot is None:
                            try:
                                asset_snapshot = task_asset_cache.prepare(
                                    task,
                                    repo=repo,
                                    resolved_sha=task_sha,
                                    expected_dependency_binding=task_binding,
                                )
                            except (OSError, SandboxError, ValueError) as exc:
                                asset_snapshot_error = exc
                                raise
                        worktree = make_worktree(repo, task_sha, Path(trees))
                        sanitized_head = sanitize_clone_for_hidden_oracles(worktree)
                        graph_snapshot.materialize(worktree, sanitized_head=sanitized_head)

View on GitHub (pinned to d540b00184)

Solutions

  1. Read the wrapped exception text ({asset_snapshot_error}) — it names the underlying SandboxError/OSError/ValueError that is the real cause.
  2. Fix that root cause (missing asset, path traversal, wrong type, permission) using the guidance for the underlying error.
  3. Clear or recreate the task asset cache so prepare retries cleanly.
  4. Confirm the resolved SHA matches the SHA the snapshot was prepared for.

Example fix

// before — asset source path wrong, prepare() failed once and was cached
asset_snapshot_error = SandboxError('dependency does not exist: foo')
// after — fix the path, drop the cached failure, re-prepare
# correct task asset source, then clear cache so prepare() re-runs
Defensive patterns

Strategy: try-catch

Try / catch

from .proposer_sandbox import SandboxError

try:
    asset_snapshot = task_asset_cache.prepare(task, repo=repo, resolved_sha=task_sha, expected_dependency_binding=task_binding)
except (OSError, SandboxError, ValueError) as exc:
    # real cause is in exc; surface to the operator and skip the arm
    asset_snapshot_error = exc
    log.error('asset snapshot prepare failed: %s', exc)

Prevention

When it happens

Trigger: task_asset_cache.prepare(...) raised OSError/SandboxError/ValueError on a previous iteration (asset_snapshot_error is set), so the guard `if asset_snapshot_error is not None: raise RuntimeError(...)` fires for subsequent arms before retrying.

Common situations: A task-declared asset path is missing, escapes the repo, or has a bad type (surfacing first as one of the _safe_repo_source/_prepare_clone_target errors); the dependency snapshot source is corrupt; a transient FS error (permissions, disk full) on the staging directory; the cache key/SHA mismatch yields a ValueError.

Related errors


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