pypa / gh-action-pypi-publish

The blessed :octocat: GitHub Action, for publishing your :package: distribution files to PyPI, the tokenless way: https://github.com/marketplace/actions/pypi-publish
https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
BSD 3-Clause "New" or "Revised" License
930 stars 87 forks source link

HTTPError: 413 Request Entity Too Large from https://pypi.org/legacy/ #285

Closed andife closed 3 days ago

andife commented 3 days ago

I am currently in the process of converting the publish / release process to trusted publishing and am using the gh-action-pypi-publish for this. I am a bit puzzled as the process worked when I published to testpypi, but now it no longer works with pypi. I wonder if it could be related to the github action, or a configuration option that should still be set?

HTTPError: 413 Request Entity Too Large from https://pypi.org/legacy/

grafik

Do I have to split the publishing? Or is it only an issue of the pypi server?

Thanks a lot

https://github.com/onnx/onnx/issues/6499

webknjaz commented 3 days ago

@andife I think you might be hitting PyPI's size limits. You can try requesting higher limits from them: https://pypi.org/help/#file-size-limit. Judging by the file sizes @ https://github.com/onnx/onnx/actions/runs/11545065797#artifacts, individual dists should be fine, but perhaps you've hit an overall project size limit.

This could also be some sort of a temporary outage. There's no way for me to know. Maybe, @di / @woodruffw would be able to check the PyPI logs. But it could also be a temporary fluke. It might work the next time. I'd retry to verify this.

FWIW, the error is printed out by Twine. We just call it and have no way of handling it. If you believe there's a client-side bug, report it on their tracker. If it keeps happening, try opening a bug @ pypi/warehouse. But in general, I don't see how it would be caused by the action itself so I'm closing the issue for now.

woodruffw commented 3 days ago

Yeah, that looks like a PyPI quota error.

andife commented 3 days ago

Thanks for the answer, but which quota exactly? according to https://pypi.org/manage/project/onnx-weekly/settings/ there should be enough project space

image

I have the same quotas as for test.pypi.org where publishing was succesful one week before i switched to pypi.org

webknjaz commented 3 days ago

Maybe the project upload one? I'm not sure. I'd try to cut another release to see if that was a glitch. I don't have visibility into the PyPI internal to know for sure.

di commented 2 days ago

This is not a file or project size limit error, PyPI will return a 400 with a proper error message for those: https://github.com/pypi/warehouse/blob/be3a4853ea42b2201d07a6b5a1ed40ae08cf151f/warehouse/forklift/legacy.py#L942-L962

woodruffw commented 2 days ago

Triaging some more now -- the only place I can find HTTPRequestEntityTooLarge in Warehouse is in the search route, which has a custom message anyways:

https://github.com/pypi/warehouse/blob/be3a4853ea42b2201d07a6b5a1ed40ae08cf151f/warehouse/views.py#L348

...so that's not it. I'll keep looking.

woodruffw commented 2 days ago

I looked a bit more into the workflow itself (https://github.com/onnx/onnx/actions/runs/11545065797/job/32132991237), and it has attestations: false. So it's not caused by that, at least.

AFAICT there is nowhere else in PyPI that can return an HTTP 413, so I'm mystified by this one.

Edit: I looked a bit more, and as best I can tell this originates from gunicorn or nginx itself.

andife commented 1 day ago

Many thanks for the further investigations

webknjaz commented 1 day ago

@andife did you happen to attempt a rerun? This would be an additional data point for the investigators.

andife commented 1 day ago

It happened twice. At the moment the dev build happens only by weekly schedule. We had to add a manual transfer trigger for a dev build...