uv icon indicating copy to clipboard operation
uv copied to clipboard

`uv tool install` failing to install due to 'Permission denied'

Open cchristous opened this issue 7 months ago • 3 comments

Summary

Hi,

I am seeing a 'Permission denied' error when trying to install a tool using uv tool install:

+/tmp/script_314.sh:366> brew install uv
==> Downloading https://ghcr.io/v2/homebrew/core/uv/manifests/0.7.3
==> Fetching uv
==> Downloading https://ghcr.io/v2/homebrew/core/uv/blobs/sha256:3d300ee7ebcfa7e0ef7802ddec4fdbf0ac6e023851bad35460ba9f58dc5951d8
==> Pouring uv--0.7.3.ventura.bottle.tar.gz
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/uv/0.7.3: 17 files, 37.2MB
==> Running `brew cleanup uv`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).


+/tmp/script_314.sh:367> uv tool install <tool> --with-requirements /Users/<user-name>/requirements-ami.txt --python 3.11
Downloading cpython-3.11.12-macos-x86_64-none (download) (17.5MiB)
 Downloading cpython-3.11.12-macos-x86_64-none (download)
error: Permission denied (os error 13) at path "/var/folders/sk/1rps9wzs79zdj9f2wz8m0yf00000gn/T/.tmpjKWSI5"
Provisioning step had errors: Running the cleanup provisioner, if present...

I run these commands via packer to provision AWS AMIs. This last worked 5 days ago on uv 0.7.2. I've made no other changes to the AMI provisioning since the last success. It is possible that other brew package updates could have caused this issue, but that seems unlikely at this point.

Platform

macOS 13 ARM64 and AMD64

Version

0.7.3

Python version

Python 3.11.12

cchristous avatar May 13 '25 00:05 cchristous

Does it work if you go back to uv 0.7.2, or was this a change in the environment? Are any XDG or UV_ variables set, as /var/folders/sk isn't a usual build folder?

konstin avatar May 13 '25 06:05 konstin

I've switched to installing uv via pipx, and I've pinned it to 0.7.2 and the install works properly. I've not set any XDG or UV_ variables.

cchristous avatar May 13 '25 13:05 cchristous

I've continued using the pipx install method and unpinned the version, allowing 0.7.3 to be used, and it fails again.

cchristous avatar May 13 '25 20:05 cchristous

I don't think we changed anything meaningful between those versions. I think this is probably an issue on the host?

charliermarsh avatar May 20 '25 13:05 charliermarsh

Well, it consistently works with 0.7.2 and consistently fails with 0.7.3. If there is some debugging data that would be helpful, I am happy to try to collect it.

cchristous avatar May 20 '25 14:05 cchristous

I am having this issue as well.

kkjdaniel avatar Jul 16 '25 00:07 kkjdaniel

@kkjdaniel does this also work for you on 0.7.2 and fail on 0.7.3?

zanieb avatar Jul 16 '25 04:07 zanieb

I get the same issue (base) ~ curl -LsSf https://astral.sh/uv/install.sh | sh downloading uv 0.8.2 aarch64-apple-darwin no checksums to verify installing to /Users/xxxx/.local/bin uv uvx everything's installed! sh: line 1453: /Users/xxxxxx/.bash_profile: Permission denied sh: line 1454: /Users/xxxxxx/.bash_profile: Permission denied mkdir: /Users/xxxxxx/.config/fish/conf.d: Permission denied ERROR: command failed: mkdir -p /Users/xxxxxx/.config/fish/conf.d Same thing when I tried running with sudo

Crypto69 avatar Jul 23 '25 02:07 Crypto69

I'd like to report that after I upgraded to macOS 15, this issue no longer occurs.

cchristous avatar Oct 02 '25 18:10 cchristous

installing via pip worked for me: pip install uv

Florin-Birgu avatar Oct 06 '25 13:10 Florin-Birgu

I get the same issue (base) ~ curl -LsSf https://astral.sh/uv/install.sh | sh downloading uv 0.8.2 aarch64-apple-darwin no checksums to verify installing to /Users/xxxx/.local/bin uv uvx everything's installed! sh: line 1453: /Users/xxxxxx/.bash_profile: Permission denied sh: line 1454: /Users/xxxxxx/.bash_profile: Permission denied mkdir: /Users/xxxxxx/.config/fish/conf.d: Permission denied ERROR: command failed: mkdir -p /Users/xxxxxx/.config/fish/conf.d Same thing when I tried running with sudo

Ditto running MacOS 15.1. Installing via brew works fine.

pbitzer avatar Oct 16 '25 14:10 pbitzer

Are the problems you are reporting for installing uv itself, or for running uv tool install?

konstin avatar Oct 16 '25 20:10 konstin

Are the problems you are reporting for installing uv itself, or for running uv tool install?

Ah, sorry. That output is when I run the curl command to download and install uv: curl -LsSf https://astral.sh/uv/install.sh | sh Using the brew instructions to install works fine.

pbitzer avatar Oct 16 '25 21:10 pbitzer

This bug is about a uv tool install problem, could you open a separate issue with logs and other information that could be relevant, such as security software and the permissions on the paths in the error message?

konstin avatar Oct 16 '25 21:10 konstin