Skip to content

Fix UV cache permission error in sandbox container - #42

Merged
kashifulhaque merged 2 commits into
mainfrom
copilot/fix-cache-permission-error
Jan 20, 2026
Merged

kashifulhaque merged 2 commits into
mainfrom
copilot/fix-cache-permission-error

Conversation

Copilot AI commented Jan 20, 2026 •

Copy link
Copy Markdown
Contributor

UV fails to initialize cache in the sandbox container due to permission denied on /home/sandboxuser/.cache/uv. The tmpfs mount at /home/sandboxuser/.cache (configured in compose.yml) inherits incorrect ownership when the directory doesn't exist in the image.

Changes

  • Create /home/sandboxuser/.cache directory with proper ownership in sandbox/Dockerfile before switching to non-root user
# Before
RUN adduser -D sandboxuser
USER sandboxuser

# After
RUN adduser -D sandboxuser && \
    mkdir -p /home/sandboxuser/.cache && \
    chown -R sandboxuser:sandboxuser /home/sandboxuser/.cache
USER sandboxuser

The directory now exists with correct ownership when the tmpfs mount is applied at runtime, allowing UV to initialize its cache successfully.

Original prompt

I keep getting this error:

error: Failed to initialize cache at `/home/sandboxuser/.cache/uv`
  Caused by: failed to create directory `/home/sandboxuser/.cache/uv`: Permission denied (os error 13)

When I run docker logs --follow sandbox. Please fix.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…r ownership

Co-authored-by: kashifulhaque <37375667+kashifulhaque@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix permission error for cache directory initialization Fix UV cache permission error in sandbox container Jan 20, 2026
Copilot AI requested a review from kashifulhaque January 20, 2026 17:01
@kashifulhaque
kashifulhaque marked this pull request as ready for review January 20, 2026 17:34
Copilot AI review requested due to automatic review settings January 20, 2026 17:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a permission error preventing UV from initializing its cache in the sandbox container. The issue occurs because the tmpfs mount at /home/sandboxuser/.cache (configured in compose.yml) inherits incorrect ownership when the directory doesn't exist in the image.

Changes:

  • Creates /home/sandboxuser/.cache directory with proper ownership in the Dockerfile before switching to the non-root user
  • Ensures the directory exists with correct permissions when the tmpfs mount is applied at runtime

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kashifulhaque
kashifulhaque self-requested a review January 20, 2026 17:37
@kashifulhaque
kashifulhaque merged commit d556739 into main Jan 20, 2026
8 checks passed
@kashifulhaque
kashifulhaque deleted the copilot/fix-cache-permission-error branch January 20, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants