Skip to content
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

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

Closed
andife opened this issue Nov 5, 2024 · 17 comments
Closed

Comments

@andife
Copy link

andife commented Nov 5, 2024

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

onnx/onnx#6499

@webknjaz
Copy link
Member

webknjaz commented Nov 5, 2024

@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.

@webknjaz webknjaz closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2024
@woodruffw
Copy link
Member

Yeah, that looks like a PyPI quota error.

@andife
Copy link
Author

andife commented Nov 5, 2024

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
Copy link
Member

webknjaz commented Nov 5, 2024

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
Copy link
Member

di commented Nov 6, 2024

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
Copy link
Member

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
Copy link
Member

woodruffw commented Nov 6, 2024

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
Copy link
Author

andife commented Nov 7, 2024

Many thanks for the further investigations

@webknjaz
Copy link
Member

webknjaz commented Nov 7, 2024

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

@andife
Copy link
Author

andife commented Nov 7, 2024

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...

@andife
Copy link
Author

andife commented Nov 11, 2024

@webknjaz webknjaz reopened this Nov 12, 2024
@webknjaz
Copy link
Member

Okay, I reopened for visibility but I think it might need to be moved to Warehouse.

@di @woodruffw WDYT?

@webknjaz
Copy link
Member

@webknjaz I think this is nginx indeed:
Screenshot_2024-11-12-09-10-48-05_320a9a695de7cdce83ed5281148d6f19.jpg

@di
Copy link
Member

di commented Nov 12, 2024

Can't move this issue across orgs to https://github.com/pypi/warehouse but if someone can file an issue there we can look into this more.

@andife
Copy link
Author

andife commented Nov 13, 2024

I opened an issue: pypi/warehouse#17076

@ewdurbin
Copy link
Member

ewdurbin commented Nov 13, 2024

onnx/onnx@3763953 is root cause.

The upload endpoint was coded as https://pypi.org/legacy (it should be https://upload.pypi.org/legacy) which has a much stricter body size limit, so the upload is bounced before warehouse gets a chance to say "hey this isn't the upload endpoint"

@webknjaz
Copy link
Member

Thanks, Ee!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants