Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The cache user directory is non-writable (owned by root). #283

Closed
hadim opened this issue Oct 1, 2024 · 10 comments
Closed

The cache user directory is non-writable (owned by root). #283

hadim opened this issue Oct 1, 2024 · 10 comments
Labels

Comments

@hadim
Copy link
Member

hadim commented Oct 1, 2024

Comment:

The cache user directory (/home/conda/.cache) is non-writable (owned by root).

I noticed this while building locally from a feedstock bash .scripts/run_docker_build.sh using rattler-build and got the below error:

 ╰─────────────────── (took 8 seconds)
 × error Error building package: Failed to resolve dependencies: failed to acquire a lock on the repodata cache
Error:   × Failed to resolve dependencies: failed to acquire a lock on the repodata cache
  ├─▶ failed to acquire a lock on the repodata cache
  ├─▶ failed to open: /home/conda/.cache/rattler/cache/repodata/3018e552.lock
  ╰─▶ Permission denied (os error 13)

You can check the permissions of the cache folder with:

$ docker run --rm -ti quay.io/condaforge/linux-anvil-cos7-x86_64:latest ls -la /home/conda/.cache 
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
total 12
drwxr-xr-x 3 root  root  4096 Oct  1 22:06 .
drwx------ 3 conda conda 4096 Oct  1 22:06 ..
drwxr-xr-x 2 root  root  4096 Oct  1 22:06 rosetta

The cache folder in the image is empty except for one empty folder called rosetta/.

I am not sure from where this root permission is coming from and what is this rosetta/ folder as well.

@hadim hadim added the question label Oct 1, 2024
@hadim
Copy link
Member Author

hadim commented Oct 1, 2024

Maybe worth noting, I am running the docker build from a macOS Silicon laptop.

@hadim
Copy link
Member Author

hadim commented Oct 1, 2024

Ok so it seems to be macOS specific....

On a Linux machine:

docker run --rm -ti quay.io/condaforge/linux-anvil-cos7-x86_64:latest ls -la /home/conda/
total 24
drwx------ 2 conda conda 4096 Oct  1 22:20 .
drwxr-xr-x 1 root  root  4096 Oct  1 22:20 ..
-rw-r--r-- 1 conda conda   18 Nov 24  2021 .bash_logout
-rw-r--r-- 1 conda conda  193 Nov 24  2021 .bash_profile
-rw-r--r-- 1 conda conda  231 Nov 24  2021 .bashrc
-rw-r--r-- 1 conda conda   75 Oct  1 22:20 .condarc

It's not a c-f bug, so I will close here.

@hadim hadim closed this as completed Oct 1, 2024
@hadim
Copy link
Member Author

hadim commented Oct 1, 2024

For the record: docker/for-mac#7440

@hadim
Copy link
Member Author

hadim commented Oct 1, 2024

Again for the record as a quick workaround:

export CONDA_FORGE_DOCKER_RUN_ARGS="-e XDG_CACHE_HOME=/tmp/.cache"
bash .scripts/run_docker_build.sh

@jakirkham
Copy link
Member

Interesting am on a Mac, but am using Rancher Desktop. This is what I see

$ docker run --rm -ti quay.io/condaforge/linux-anvil-cos7-x86_64:latest ls -la /home/conda/
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
total 24
drwx------ 2 conda conda 4096 Oct  1 22:35 .
drwxr-xr-x 1 root  root  4096 Oct  1 22:35 ..
-rw-r--r-- 1 conda conda   18 Nov 24  2021 .bash_logout
-rw-r--r-- 1 conda conda  193 Nov 24  2021 .bash_profile
-rw-r--r-- 1 conda conda  231 Nov 24  2021 .bashrc
-rw-r--r-- 1 conda conda   75 Oct  1 22:35 .condarc

So agree it looks like a Docker Desktop specific bug

@hadim
Copy link
Member Author

hadim commented Oct 1, 2024

Switching to Rancher now :-)

@hadim
Copy link
Member Author

hadim commented Oct 1, 2024

It's actually more a docker emulation engine question than docker versus rancher.

When I enable the Rosetta emulation (in order to run linux-64 build) then I get the same issue as above.

@jakirkham
Copy link
Member

Interesting when using the aarch64 container on my Mac, don't see the issue either

$ docker run --rm -ti quay.io/condaforge/linux-anvil-aarch64 ls -la /home/conda/
total 24
drwx------ 2 conda conda 4096 Oct  2 00:19 .
drwxr-xr-x 1 root  root  4096 Oct  2 00:19 ..
-rw-r--r-- 1 conda conda   18 Nov 24  2021 .bash_logout
-rw-r--r-- 1 conda conda  193 Nov 24  2021 .bash_profile
-rw-r--r-- 1 conda conda  231 Nov 24  2021 .bashrc
-rw-r--r-- 1 conda conda   75 Oct  2 00:19 .condarc

So could be some corner case. Not really sure

@hadim
Copy link
Member Author

hadim commented Oct 2, 2024

I think it only happens when the host is on a different arch. This is when Rosetta is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants