You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Report why Pip's PyPI version lookups fail - #5791
When Pip's in-process update check cannot resolve a package against pypi.org, the exception is only written with Logger.Debug, which never reaches user logs. The Manager statuses page and the task log only say 1 of 1 version lookups against https://pypi.org/ failed, the update list would be incomplete, with no cause.
In #5787 every check hangs for the 20 second client timeout while pip itself works from a terminal, and the logs give nothing to tell a connection timeout from a TLS or DNS failure.
Change
VersionResolution carries the failure's exception chain (DescribeFailure: type and message of every inner exception).
GetAvailableUpdatesFromIndex writes each failed lookup's reason to the Pip task log.
The exception raised when too many lookups fail ends with First failure: <package>: <reason>, so it shows on Manager statuses too.
No behaviour change otherwise: the same lookups run, and the same threshold decides whether the check fails.
This does not fix#5787 itself; it is meant to show the actual cause in the reporter's next log.
Tests
ResolveLatestVersionReportsWhyALookupFailed: a stalled handler with a 200 ms HttpClient.Timeout yields a failure whose reason names the timeout.
DescribeFailureIncludesEveryInnerException.
PipManagerTests: 72/72 passed. dotnet format whitespace and dotnet format style both exit 0.
When the in-process update check could not resolve a package against
pypi.org, the exception was only written with Logger.Debug, which never
reaches user logs. Users saw "1 of 1 version lookups against
https://pypi.org/ failed" with no cause, so a report like #5787 (every
check hanging for the 20 second client timeout while pip itself works
from a terminal) could not be diagnosed.
Each failed resolution now carries its exception chain. It is written
to the Pip task log for every package, and the first one is appended to
the error raised when too many lookups fail, so it shows on the Manager
statuses page as well.
Related to #5787
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Improves diagnostics for Pip’s in-process PyPI update checks to help investigate #5787. The change exposes failure causes without changing lookup behavior or the existing failure threshold; it does not fix the underlying connectivity issue.
Changes:
Carries exception types and messages through version-resolution results.
Adds per-package failure reasons to task logs and the first failure to the manager-status exception.
Adds tests for timeout diagnostics and nested exception formatting.
When the 45 second resolution budget cancelled a lookup, the recorded
reason was only "The operation was canceled.", which does not say that
the overall check ran out of time. A lookup cancelled while its budget
token is set now says so, ahead of the original exception chain.
A lookup that failed for a package with a cached version returned that
version before its reason was kept, so a failed refresh left nothing in
the task log. The reason now travels with the cached result and is
logged as information. Failed stays false there, so the failure
threshold and the cached-result behaviour are unchanged.
Related to #5787
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The normal manager log hides NativeTaskLogger's information stream (AsColoredString(false) shows only ...), so a cached lookup failure is still invisible there unless the user selects the verbose log. Since this path also keeps Failed false, it produces no manager-status error either. Please write the refresh failure to a channel visible in the normal log while retaining the cached-result behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #5787
Problem
When Pip's in-process update check cannot resolve a package against pypi.org, the exception is only written with
Logger.Debug, which never reaches user logs. The Manager statuses page and the task log only say1 of 1 version lookups against https://pypi.org/ failed, the update list would be incomplete, with no cause.In #5787 every check hangs for the 20 second client timeout while
pipitself works from a terminal, and the logs give nothing to tell a connection timeout from a TLS or DNS failure.Change
VersionResolutioncarries the failure's exception chain (DescribeFailure: type and message of every inner exception).GetAvailableUpdatesFromIndexwrites each failed lookup's reason to the Pip task log.First failure: <package>: <reason>, so it shows on Manager statuses too.No behaviour change otherwise: the same lookups run, and the same threshold decides whether the check fails.
This does not fix #5787 itself; it is meant to show the actual cause in the reporter's next log.
Tests
ResolveLatestVersionReportsWhyALookupFailed: a stalled handler with a 200 msHttpClient.Timeoutyields a failure whose reason names the timeout.DescribeFailureIncludesEveryInnerException.PipManagerTests: 72/72 passed.dotnet format whitespaceanddotnet format styleboth exit 0.