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

pip install with redirection does not hit the cache #11701

Closed
1 task done
tibortakacs opened this issue Jan 5, 2023 · 1 comment
Closed
1 task done

pip install with redirection does not hit the cache #11701

tibortakacs opened this issue Jan 5, 2023 · 1 comment
Labels
resolution: duplicate Duplicate of an existing issue/PR

Comments

@tibortakacs
Copy link

Description

If the pypi repository (specified in --index-url) uses URL redirections with changing URLs, the cache does not provide the previously downloaded and stored wheels from the cache but provides "No cache entry available" message and downloads the wheel again.

One example is Azure ADO feeds that use URL redirection in a certain way: the actual wheels are stored in a blob storage whose URLs changes in each call. It looks like that pip stores the responses specifically to the URLs, the cache entries are never used again.

Expected behavior

I would expect that the wheel the is downloaded after the chain of redirections are referenced to the original URL in the cache.

pip version

Latest main (a057c9b) and 22.3.1

Python version

Python 3.8

OS

Ubuntu 20.04

How to Reproduce

I executed the following installation command twice:
pip install black -vv --index-url=https://microsoft.pkgs.visualstudio.com/MyProject/_packaging/my_repository/pypi/simple/

Output

Here is the relevant part of the output of the first run:

  Looking up "https://microsoft.pkgs.visualstudio.com/<ID_A>/_packaging/<ID_B>/pypi/download/black/22.12/black-22.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" in the cache
  No cache entry available
  https://microsoft.pkgs.visualstudio.com:443 "GET /<ID_A>/_packaging/<ID_B>/pypi/download/black/22.12/black-22.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl HTTP/1.1" 303 0
  Status code 303 not in (200, 203, 300, 301, 308)
  Looking up "https://vsblob<BLOB>.vsblob.vsassets.io/b-<LONG_URL_X>black-22.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl%<...>" in the cache
  No cache entry available
  Starting new HTTPS connection (1): vsblob<BLOB>.vsblob.vsassets.io:443 "GET ...

And, from the second run:

  Looking up "https://microsoft.pkgs.visualstudio.com/<ID_A>/_packaging/<ID_B>/pypi/download/black/22.12/black-22.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" in the cache
  No cache entry available
  https://microsoft.pkgs.visualstudio.com:443 "GET /<ID_A>/_packaging/<ID_B>/pypi/download/black/22.12/black-22.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl HTTP/1.1" 303 0
  Status code 303 not in (200, 203, 300, 301, 308)
  Looking up "https://vsblob<BLOB>.vsblob.vsassets.io/b-<LONG_URL_Y>black-22.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl%<...>" in the cache
  No cache entry available
  Starting new HTTPS connection (1): vsblob<BLOB>.vsblob.vsassets.io:443 "GET ...
  https://vsblob<BLOB>.vsblob.vsassets.io:443

It shows that the redirected URLs (the actual blob URLs, LONG_URL_X and LONG_URL_Y) are different in the two runs. I think this is the reason why there is no cache hit.

Code of Conduct

@tibortakacs tibortakacs added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jan 5, 2023
@uranusjr
Copy link
Member

uranusjr commented Jan 5, 2023

See discussions in #10694.

@uranusjr uranusjr closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2023
@uranusjr uranusjr added resolution: duplicate Duplicate of an existing issue/PR and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Jan 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: duplicate Duplicate of an existing issue/PR
Projects
None yet
Development

No branches or pull requests

2 participants