Pylons / waitress

Waitress - A WSGI server for Python 3
https://docs.pylonsproject.org/projects/waitress/en/latest/
Other
1.44k stars 164 forks source link

Receive error 413 Request entity is too large #421

Closed HelenHHMM closed 10 months ago

HelenHHMM commented 11 months ago

I have a Dash app which is served by Waitress server, but I receive error 413 ( Request entity is too large) when my app send a request to retrieve data. The Waitress document says the default max request body size is 1GB, however my response content is only 25M but the error comes up. My question is any workaround that I can config the max request body size?

mmerickel commented 11 months ago

The 1gb limit is on the bytes in the body of a request sent to waitress. Talking about your 25mb response size is meaningless with respect to a 413 error. Can you give us any more detail about the failing request? Headers? Are you sure the error is generated by waitress and not your app?

HelenHHMM commented 11 months ago

Hi, thanks for your reply. I am still not quite sure if the error comes from app or waitress. But I run app locally and no issue comes up when I am trying to plot the same data. So I am guessing the issue is from waitress server. My app sends HTTP request to another website (let's call data source website) to retrieve dataset and display boxplots with Dash.
When I get the response from data source website and use 'len(response.content)' to check the response size, it is only 20Mb, I feel like the response data is not exceed the request limit sent to waitress. Any ideas about it? Thanks so much.

mmerickel commented 11 months ago

Are you running your app behind a proxy like nginx? Look at its settings too. It's likely the culprit. And again, at least waitress will only return a 413 for the number of bytes in the REQUEST. The response size is not restricted by waitress.