-
Notifications
You must be signed in to change notification settings - Fork 3k
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
502 Errors from PyPI are not surfaced #12008
Comments
We also observed a variant of this, although our version did actually report the 502 in the
(So maybe this is a place where the errors need to be unified, or possibly a discrepancy between |
@woodruffw do you know what version of pip was being used? it appears to be a regression in 23.1.x to me. Edit: I see that that was file downloads (which were also getting transient 502s). I think that's working as expected (though retries would be nice). |
Yep, I think this was just because the 502 hit during the file download, rather than the index download 🙂 I suspect the Indeed:
|
This is the way it is for historical reasons... maybe it can be changed now? Historically pip didn't treat failed index / file urls fetches as an error state, but rather it just skipped those urls. This came from the days when we would spider a bunch of URLs and we had no way of knowing in advance whether or not those URLs were expected to work or not. Now adays we generally expect those URLs to work, so it's less defensible to just skip failing URLs. That being said, it is sometimes used to have pip have multiple repositories configured to use as fallbacks in case there is an outage at one of them, and turning this case into a hard error case would prevent that. At a minimum warning when we get a failure on a request get seems warranted, and maybe we should move to hard failing. |
As an initial matter, some heuristics like "if there's only a single index, make errors noisy" seems like a good idea to me, if we want to go for a more middle ground. As @woodruffw noted, if the errors happen during package download, they are noisy, so it's not clear to me you can do the fallback-in-case-of-outage thing reliably even today. |
The assumption there is that either the host server is completely borked or not borked at all. A borked server would trigger a fallback whereas a half-broken server (that serves index pages but not the files successfully) triggers a loud error. |
I'm OK with hard failures when we get an error from any index server, or with the proposed error out if the only index returns an error, or with a "all indexes errored out" as well. |
To be clear, I don't have a strong preference one way or the other. I'm just providing historical context for why it is the way it is currently. |
Description
There was a transient outage that caused 502s to be returned from PyPI's CDN edge.
Rather than surfacing this error, it appears that pip instead reported that no distributions were found:
Expected behavior
pip should surface the error and perhaps retry rather than reporting that a version is not found.
pip version
23.1.2
Python version
3.11
OS
Ubuntu GHA flavored
How to Reproduce
Attempt to
pip install
from an index which returns 502 on simple requests.Observe that rather than surfacing the error, pip reports that no distributions are available.
Output
Code of Conduct
The text was updated successfully, but these errors were encountered: