FileSizeExceededError causes connection reset in gunicorn
- Dominant language
- Python
- Stars
- 186
- Forks
- 117
- Avg merge
- 11d 20h
- Merged PRs (30d)
- 1
Description
# Description
Might not be the best issue title, I'm not quite sure what is happening myself. When I "push" a file that is too large as an input, the "File size for input exceeded" message is readable when I am using the basic server (a pywps Service through `werkzeug.serving.run_simple`). However, when using `gunicorn`, the connexion is reset and the client fails with `('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))`, coming from the `request` package.
I have another setup, where the pywps service is launched the same way (with `gunicorn`), but is also behind nginx and twitcher (see comment below). In that case, I did receive a proper Exception xml, but not the good one:
```xml
Request failed: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))
```
Note that this other server is on another machine, while my first simple setup has the client and server on the same machine. Also, I am able to bypass `nginx` and `twitcher` on the second setup, which gave me the exact same error as my simple local setup : `ConnectionResetError`.
I am in fact using `finch` (https://github.com/bird-house/finch) as the pyWPS Service. The simple `run_simple` server is actually taken from `emu` (https://github.com/bird-house/emu/).
I am using `birdy` and `owslib` for the client side.
# Environment
- operating system: Linux
- Python version: 3.8
- PyWPS version: 4.4.0
- source/distribution
- [x] git clone
- [ ] Debian
- [ ] PyPI
- [ ] zip/tar.gz
- [ ] other (please specify):
- web server
- [ ] Apache/mod_wsgi
- [ ] CGI
- [x] other (please specify): `werkzeug.serving.run_simple` when it works, `gunicorn` when it doesn't.
# Steps to Reproduce
This is the simplest way I can think of to reproduce the bug, but it involves `emu` and `birdy`. Sorry I am still a noob in this wps thing.
**Server**. With `emu` installed, in a terminal:
```
emu start --maxsingleinputsize 1mb
```
**Client**. With `birdy` installed, in a python session:
```python
from birdy import WPSClient
wps = WPSClient('http://127.0.0.1:5000')
wps.inout(dataset="path/to/a/netcdf/file/larger/than/a/few/MBs")
```
# Additional Information
(*) @tlvu Can you give basic details on how your dev server is different from me calling `gunicorn --bind=0.0.0.0:5000 finch.wsgi:application` in a terminal? EDIT: Added some info relating to that different setup.
Contributor guide
Assessment
This issue has not been assessed yet.