uv throws "Permission denied" error inside Codex sandbox on Linux
Running the uv Python package manager from inside a Codex sandbox, both as a VS Code extension and as the CLI tool, causes a "Permission denied" error on my Ubuntu system:
$ npx @openai/codex
› run `uv run --verbose python3 -c 'print("hello world")'`
• Ran uv run --verbose python3 -c 'print("hello world")'
└ DEBUG uv 0.9.11
error: failed to open file `/home/ubuntu/.cache/uv/sdists-v9/.git`: Permission denied (os error 13)
It now tries to re-run with with_escalated_permissions=true on its tool call, which succeeds:
• Running uv run --verbose python3 -c 'print("hello world")'
Would you like to run the following command?
Reason: Requires access to uv cache directory outside sandbox; rerunning without sandbox to complete user command
$ uv run --verbose python3 -c 'print("hello world")'
› 1. Yes, proceed (y)
2. Yes, and don't ask again for this command (a)
3. No, and tell Codex what to do differently (esc)
• Ran uv run --verbose python3 -c 'print("hello world")'
└ DEBUG uv 0.9.11
DEBUG Acquired shared lock for `/home/ubuntu/.cache/uv`
… +53 lines
DEBUG Command exited with code: 0
DEBUG Released lock at `/home/ubuntu/.cache/uv/.lock`
If I try to read the offending file directly, there's no error:
› run `cat /home/ubuntu/.cache/uv/sdists-v9/.git`
• Explored
└ Read .git
─ Worked for 4s ───────────────
• cat /home/ubuntu/.cache/uv/sdists-v9/.git produced no output (file is empty).
If there's anything I can do to help debug the problem, please let me know!
This is happening with the latest uv and codex, but it's been happening for a while, so I don't think it's a newly-introduced problem.
codex-cli version: 0.63.0
uv 0.9.11
Python 3.14.0
Ubuntu 25.04
This is a copy of https://github.com/astral-sh/uv/issues/16820. @zanieb helpfully suggested that this might happening because uv is writing to a .git placeholder file, but they're unsure if there's anything that can be done on uv's end to fix it.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗