Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

FileSizeExceededError causes connection reset in gunicorn

Aperta
#596 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
api, backend

Direzione di ricerca

Riproduci il malfunzionamento con emu usando --maxsingleinputsize 1mb, quindi confronta werkzeug.serving.run_simple con gunicorn --bind=0.0.0.0:5000 finch.wsgi:application; l’esempio del client usa birdy e un input NetCDF di grandi dimensioni. Traccia come viene gestito FileSizeExceededError tramite gunicorn, nginx e twitcher, e considera il problema risolto quando un input troppo grande restituisce l’eccezione leggibile prevista invece di reimpostare la connessione o produrre BrokenPipeError.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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:

<Exception exceptionCode="NoApplicableCode" locator="NotAcceptable">
        <ExceptionText>Request failed: (&#x27;Connection aborted.&#x27;, BrokenPipeError(32, &#x27;Broken pipe&#x27;))</ExceptionText>
</Exception>

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
  • git clone
  • Debian
  • PyPI
  • zip/tar.gz
  • other (please specify):
  • web server
  • Apache/mod_wsgi
  • CGI
  • 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:

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.

Lingua principale
Python
Stelle
186
Fork
117
Merge medio
17g 23h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di geopython/pywps

Tutte le issue di geopython/pywps

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.