mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.79k stars 348 forks source link

Don't try to write SOLV cache in read-only directories #3312

Open jaimergp opened 3 months ago

jaimergp commented 3 months ago

Troubleshooting docs

Anaconda default channels

How did you install Mamba?

Other (please describe)

Search tried in issue tracker

writable read-only cache

Latest version of Mamba

Tried in Conda?

Not applicable

Describe your issue

Comes from https://github.com/conda/conda-libmamba-solver/issues/522

conda-libmamba-solver + libmamba 1.5.x cannot operate on read-only caches because loading via api.Repo(...) always tries to write the SOLV cache file back to disk, and fails to do so in the write permissions are not there:

File "/tmp/software/python/3.11.4/lib/python3.11/site-packages/conda_libmamba_solver/index.py", line 293, in _json_path_to_repo_info

    repo = api.Repo(self._pool, noauth_url, str(path_to_use), escape_channel_url(noauth_url))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

RuntimeError: Permission denied

I think this line:

https://github.com/mamba-org/mamba/blob/4f269258b4237a342da3e9891045cdd51debb27c/libmamba/src/core/repo.cpp#L332

should have some error handling because that write_solv() call is not critical to the repo loading. Nice to have, sure, but not required.

mamba info / micromamba info

libmamba 1.5.8

Logs

No response

environment.yml

No response

~/.condarc

No response

jaimergp commented 2 months ago

Just learnt that this is solved in v2, so feel free to close if 1.x is not being maintained anymore.