mamba-org / mamba

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

url redirect in channel_alias makes the cache invalid #3275

Closed gzm55 closed 2 months ago

gzm55 commented 2 months ago

Troubleshooting docs

Anaconda default channels

How did you install Mamba?

Micromamba

Search tried in issue tracker

redirect, 301

Latest version of Mamba

Tried in Conda?

I didn't try

Describe your issue

when setting channel_alias to a gateway url, such as https://corp/conda which will redirect (301,302) the url to the real internal mirror. e.g., GET https://corp/conda/defaults --(301)--> https://internal/conda-mirror/conda-defaults

This works when first install a package. bug the redirected url (https://internal/conda-mirror/...) is written into the repodata_record.json in the extracted folder. This cause the warning of invalid url on the second time to install in another environment, and invalid the extracted cache.

Can we write the original url before redirection into repodata_record.json?

mamba info / micromamba info

No response

Logs

No response

environment.yml

No response

~/.condarc

No response