Skip to content

uv run fails after installing packges with root and uv 0.5.29 #11324

@jamescooke

Description

@jamescooke

Summary

Current behaviour

We have an app which installs packages with uv in root, but then uses a team user to run the app.

However, as of 0.5.29, this has stopped working. The error received when the team user tries to uv run anything is:

error: failed to create file `/tmp/uv-f348faaccf85129c.lock`: Permission denied (os error 13)

The following dockerfile reproduces the error

FROM python:3.13
COPY --from=ghcr.io/astral-sh/uv:0.5.29 /uv /bin/uv

WORKDIR /usr/src/app
RUN uv init
RUN uv add pytest

RUN useradd --user-group --create-home --uid 1000 team
USER team
RUN uv run pytest -h

This fails when built with docker build . with:

 => ERROR [stage-0 7/7] RUN uv run pytest -h                                                        0.3s
------
 > [stage-0 7/7] RUN uv run pytest -h:
0.266 error: failed to create file `/tmp/uv-f348faaccf85129c.lock`: Permission denied (os error 13)
------
Dockerfile:10
--------------------
   8 |     RUN useradd --user-group --create-home --uid 1000 team
   9 |     USER team
  10 | >>> RUN uv run pytest -h
  11 |
--------------------
ERROR: failed to solve: process "/bin/sh -c uv run pytest -h" did not complete successfully: exit code: 2

Expected behaviour

Pinning to 0.5.28 allows the build of the file above to run:

COPY --from=ghcr.io/astral-sh/uv:0.5.28 /uv /bin/uv

This is the expected behaviour (unless doing the above is deprecated - if so please could you help me understand if there's a path for root to install and "normal" users to use?)

My colleague noticed this recent change released in 0.5.29 and thought it might be related to this issue: #11259

Platform

Linux 5.15.0-131-generic x86_64 GNU/Linux

Version

uv 0.5.29

Python version

3.13.2

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions