warehouse icon indicating copy to clipboard operation
warehouse copied to clipboard

`502: Bad Gateway` on upload when `Provides-Dist` metadata is invalid instead of error messages

Open rjdbcm opened this issue 1 year ago • 2 comments

I am getting bad gateway errors the past 14 hours, only from my GitHub actions runs. Wondering if this could be related to the cause of #9151 since everything else seems to be working. My local CI works with the same token on a different repo so ~~maybe this is some sort of regional proxy service outage or something.~~

Edit 1: Now it is only for this repo but not for my other repos with the same GitHub workflow and token setup. ~~I have had the same result for GitHub actions runners 12,13, and 14.~~ Does not seem to be related to which runner I use and seems to be isolated to this package repo.

Edit 2: I have figured out the issue the core metadata specification for Provides-Dist shows a version format that will not work for warehouse as it uses packaging.requirements.Requirement to validate this header. I have opened a PR over on the spec to change the example as well https://github.com/pypa/packaging.python.org/pull/1586

Uploading distributions to https://upload.pypi.org/legacy/
Uploading 
blastpipe-2024.11.32-cp310-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
WARNING  Received "502: Bad Gateway"                                            
         Package upload appears to have failed. Retry 1 of 5.                   
Uploading 
blastpipe-2024.11.32-cp310-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
WARNING  Received "502: Bad Gateway"                                            
         Package upload appears to have failed. Retry 2 of 5.                   
Uploading 
blastpipe-2024.11.32-cp310-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
WARNING  Received "502: Bad Gateway"                                            
         Package upload appears to have failed. Retry 3 of 5.                   
Uploading 
blastpipe-2024.11.32-cp310-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
WARNING  Received "502: Bad Gateway"                                            
         Package upload appears to have failed. Retry 4 of 5.                   
Uploading 
blastpipe-2024.11.32-cp310-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
WARNING  Received "502: Bad Gateway"                                            
         Package upload appears to have failed. Retry 5 of 5.                   
WARNING  Error during upload. Retry with the --verbose option for more details. 
ERROR    HTTPError: 502 Bad Gateway from https://upload.pypi.org/legacy/        
         Bad Gateway          

rjdbcm avatar Aug 10 '24 19:08 rjdbcm

I think we're parsing this correctly and the example in the spec is wrong, see my comment here.

That said, I think returning a 502 here is not what should be happening, as we clearly intend to return some human-readable error messages, so I'll leave this open and amend the title to reflect that.

di avatar Aug 12 '24 15:08 di

I've asked @DarkaMaul to take a look at this 🙂

woodruffw avatar Aug 12 '24 16:08 woodruffw