mamba: RuntimeError on cache in multi-users case
Fail to create a new environment using mamba.
Context:
- JupyterHub installation
- Shared pkgs and envs directory with rw rights at a common group level
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/conda/exceptions.py", line 1079, in call
return func(args, kwargs)
File "/opt/conda/lib/python3.7/site-packages/mamba/mamba.py", line 941, in exception_converter
raise e
File "/opt/conda/lib/python3.7/site-packages/mamba/mamba.py", line 935, in exception_converter
exit_code = wrappedmain(args, kwargs)
File "/opt/conda/lib/python3.7/site-packages/mamba/mamba.py", line 894, in wrappedmain
result = do_call(args, p)
File "/opt/conda/lib/python3.7/site-packages/mamba/mamba.py", line 782, in do_call
exit_code = create(args, parser)
File "/opt/conda/lib/python3.7/site-packages/mamba/mamba.py", line 661, in create
install(args, parser, "create")
File "/opt/conda/lib/python3.7/site-packages/mamba/mamba.py", line 418, in install
prefix=prefix,
File "/opt/conda/lib/python3.7/site-packages/mamba/utils.py", line 73, in get_index
is_downloaded = dlist.download(True)
RuntimeError: Operation not permitted: '/usr/local/share/jupyter/pkgs/cache/ba887a88.json'
The cache file is owned by another user than the one creating the environment.
Reference: mamba 0.5.1 conda 4.8.4
Note: It was fixed by using
conda createinstead ofmamba create
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 3
- Comments: 27 (11 by maintainers)
Commits related to this issue
- Workaround for https://github.com/mamba-org/mamba/issues/488 — committed to jonashaag/pandas by jonashaag 2 years ago
- Delete cached JSONs as a work-around https://github.com/mamba-org/mamba/issues/488 — committed to aiidateam/aiida-core by sphuber 2 years ago
- Devops: Fix the `test-install.yml` workflow A few fixes were needed: * Increase timeout for `install-with-pip` and `install-with-conda` jobs These were taking a longer time. The problem for conda ... — committed to aiidateam/aiida-core by sphuber 2 years ago
- Devops: Fix the `test-install.yml` workflow A few fixes were needed: * Increase timeout for `install-with-pip` and `install-with-conda` jobs These were taking a longer time. The problem for conda ... — committed to aiidateam/aiida-core by sphuber 2 years ago
- Devops: Fix the `test-install.yml` workflow A few fixes were needed: * Increase timeout for `install-with-pip` and `install-with-conda` jobs These were taking a longer time. The problem for conda ... — committed to aiidateam/aiida-core by sphuber 2 years ago
- Devops: Fix the `test-install.yml` workflow A few fixes were needed: * Increase timeout for `install-with-pip` and `install-with-conda` jobs These were taking a longer time. The problem for conda ... — committed to aiidateam/aiida-core by sphuber 2 years ago
- Devops: Fix the `test-install.yml` workflow A few fixes were needed: * Increase timeout for `install-with-pip` and `install-with-conda` jobs These were taking a longer time. The problem for conda ... — committed to aiidateam/aiida-core by sphuber 2 years ago
- Add workaround for mamba-org/mamba#488 — committed to jfrost-mo/example-python-project by jfrost-mo 2 years ago
I am hitting a similar issue in our setup. We build linux VMs for a users using ansible. This installs mambaforge in /opt and creates an environment with our software installed, this runs as root. The VM is then given to a single user, who will use it for a few days or weeks. We want the user to be able to update the environment. We don’t know who the user will be at install time, so we
chmod +w/opt/mambaforge/envsand/opt/mambaforge/pkgs/cacheso that whichever user gets the machine they have write access there.This worked with conda and
conda update. But withmamba updatewe get:RuntimeError: Operation not permitted: '/mambaforge/pkgs/cache/b556ea5a.json'I can reproduce with the following docker file:
Build with:
docker build --no-cache -t mamba_user_test -f dockerfile .then in:
docker run -it --rm mamba_user_test bashrun:
source /mambaforge/etc/profile.d/conda.sh && conda activate test && mamba update --yes numpyA work around is for the user to remove the .json files.
rm /mambaforge/pkgs/cache/*.jsonI have the same problem when I use conda on Windows. Error message is
error libmamba Could not open lockfile 'D:\ProgramData\miniconda3\pkgs\cache\cache.lock'. The problem is current user do not have right to write ‘D:\ProgramData\miniconda3\pkgs\cache\cache.lock’`. When I open adaconda power shell as a administer, the problem goes away.I guess at least for some people that might be identical to #1123 and thus potentially addressed by #2141 .
ie mtime update to a given time denied (unless owned by effective uid), while special calling case of
utimeorutimensatallows updating timestamp to the current time as long as the file is writable.I just started seeing this issue out of nowhere as part of my Azure pipeline. During
conda mambabuild ..., I see:I presume something must have changed about permissions in this directory in the Azure docker image for Ubuntu. Similar CI with
conda buildworks as expected.Just saw this here as well: https://github.com/pandas-dev/pandas/pull/45902
While working on a script to duplicate the issue, I found a fix for my environment. Our install was shared by many users and they had write access to the pkgs & cache folders. Removing this access and setting the gid back to root resolved the issue and now shared pkg updates must be done via sudo. This forces user pkgs & envs into their home/personal environment, but that is ok for now.