Skip to content

bug: uv fails to install packages on docker based sandboxes with Cross-device link (os error 18) #1467

Closed as not planned

Description

@andreas-ntonas

Agent Diagnostic

  • Loaded debug-openshell-cluster and openshell-cli skills
  • Created diagnostic sandboxes with openshell sandbox create --name uv_diag_testX --no-keep
  • Reproduced the failure: uv tool run cowsay fails with Cross-device link (os error 18) on every run
  • Verified both paths (/sandbox/.cache/uv/.tmpXXXXXX and /sandbox/.cache/uv/archive-v0/) report the same device number (dev=56, overlayfs)
  • Confirmed manual mv (which uses rename(2)) between the same directories succeeds without error
  • Wrote and executed a Python script that calls renameat2(RENAME_NOREPLACE) directly on the same paths → confirmed it returns errno=18 (EXDEV)
  • Root cause: uv uses renameat2(2) with the RENAME_NOREPLACE flag for atomic cache population. Linux kernel 5.15 overlayfs (used by Docker-backed sandboxes) returns EXDEV for renameat2(RENAME_NOREPLACE) when source and destination are in different subdirectories, even on the same device. Standard rename(2) works fine on the same paths.
  • Gateway: local Docker driver, kernel 5.15.0-179-generic, uv 0.10.8
  • No workaround found via UV_CACHE_DIR or TMPDIR — the issue is in uv's cache write path, not the cache location

Description

When creating a sandbox using the docker driver uv is not able to install packages. Based on the investigation this is related to EXDEV (errno 18, cross-device link error) error on overlayfs. This may be related to Landlock restriction as noted on this past PR #151

Reproduction Steps

  1. Run openshell sandbox create --name 'uv_test_1'
  2. uv tool run cowsay
  3. Get error:
sandbox@33cd2528853a:~$ uv tool run cowsay
  x Failed to download `cowsay==6.1`
  |-> Failed to read from the distribution cache
  `-> failed to rename file from /sandbox/.cache/uv/.tmpKk67yS to /sandbox/.cache/uv/archive-v0/L6-C5kj-jfrluxzZ1YhlR: Cross-device link (os error 18)

Environment

  • OS: Ubuntu 22.04
  • Docker: version 29.1.3, build 29.1.3-0ubuntu3~22.04.2
  • OpenShell: v.0.0.41

Logs

  x Failed to download `cowsay==6.1`
  |-> Failed to read from the distribution cache
  `-> failed to rename file from /sandbox/.cache/uv/.tmpKk67yS to /sandbox/.cache/uv/archive-v0/L6-C5kj-jfrluxzZ1YhlR: Cross-device link (os error 18)

Agent-First Checklist

  • I pointed my agent at the repo and had it investigate this issue
  • I loaded relevant skills (e.g., debug-openshell-cluster, debug-inference, openshell-cli)
  • My agent could not resolve this — the diagnostic above explains why

Activity

  1. changed the title [-]uv fails to install packages on docker based sandboxes with Cross-device link (os error 18)[/-] [+]bug: uv fails to install packages on docker based sandboxes with Cross-device link (os error 18)[/+] on May 21, 2026
  2. TaylorMutch commented on Jul 13, 2026

    @TaylorMutch
    Collaborator

    📋 triage-agent

    Triage Assessment

    Classification: bug-confirmed

    Summary

    This is a valid Linux compatibility bug, but the evidence points to Landlock ABI 1 rather than an overlayfs device-boundary bug. Landlock ABI 1 denies cross-directory rename operations with EXDEV; uv triggers that behavior when it moves a temporary cache entry into archive-v0.

    Investigation

    OpenShell v0.0.41 already included the Landlock V2 change from #151, but best_effort compatibility negotiates down to the ABI exposed by the host kernel. Current main retains that behavior, and the existing uv E2E coverage does not exercise an ABI-1 host.

    The reported syscall attribution is also unlikely: uv 0.10.8's Linux cache persistence uses a normal rename, while mv may conceal EXDEV by falling back to copy-and-remove. The direct syscall reproduction therefore remains consistent with Landlock enforcement and does not establish an overlayfs defect. #151 is related but not a duplicate; #2173/#2241 concern a separate cert-generation rename across actual mounts.

    Recommendation

    Keep this open as a supervisor compatibility bug and add regression coverage for a Landlock ABI-1 environment. The product decision is whether to require ABI 2 for workloads needing cross-directory rename, degrade Landlock explicitly under best_effort, or document the limitation with an actionable diagnostic. In the meantime, use a host exposing Landlock ABI 2+ or an installer that does not rely on cross-directory rename.

  3. added
    os:linuxIssue affects Linux hosts
    test:e2eRequires end-to-end coverage
    and removed
    state:triage-neededOpened without agent diagnostics and needs triage
    on Jul 13, 2026
  4. github-actions commented on Aug 29, 2026

    @github-actions

    This issue has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. Comment or remove the state:stale label to keep it open.

  5. github-actions commented on Oct 13, 2026

    @github-actions

    Closing this issue after 14 days with no activity since it was marked stale. Reopen it if the work is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:supervisorProxy and routing-path workos:linuxIssue affects Linux hostsstate:staleInactive item at risk of automatic closure.test:e2eRequires end-to-end coveragetopic:compatibilityCompatibility-related work

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions