Repository navigation
Answer 502 when a Composer download's metadata lookup fails upstream - #655
Merged
andrew merged 1 commit intoNov 4, 2026
Merged
Conversation
The lookup took any non-200 metadata response for a version that isn't listed, so a Packagist outage or rate limit answered the archive request with 404. Composer treats that as the version being gone. Only 404 and 410 now mean the document is missing. A 429 is passed on as 503 with Retry-After while the upstream is held, and any other status answers 502.
andrew
approved these changes
Nov 4, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When a Composer archive isn't cached, the proxy looks up its dist URL in the p2 metadata.
findDownloadURLFromMetadatatreated every non-200 response as "version not listed", so a Packagist 5xx or 429 answered the archive request with404 version not found. Composer takes 404 as the version being gone and fails the install instead of retrying.Now only 404 and 410 mean the document is missing, so the
~devfallback and the 404 for an unlisted version work as before. A 429 is answered with 503 andRetry-Afterwhile the upstream is held, like the Maven.pomtime lookup, and any other status answers 502.A 403 also answers 502 now. #650 may want to forward a firewall's 403 here too, but that's left to it.
TestComposerDownloadLookupUpstreamErrorcovers 500 and 503 (502), 429 (503 withRetry-After) and a version that isn't listed (still 404).