Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gmolveau/5e96473349ccef1b86aa780638381a89 to your computer and use it in GitHub Desktop.
Save gmolveau/5e96473349ccef1b86aa780638381a89 to your computer and use it in GitHub Desktop.
flask/gunicorn/apache2 download/upload fails/closes/stops after 30 seconds

flask/gunicorn/apache2 download/upload fails/closes/stops after 30 seconds

Keywords : flask, gunicorn, apache2, send_file, werkzeug, requests, httpx, curl

Errors encountered

  • curl: (18) transfer closed with 9895632 bytes remaining to read
  • urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(206700544 bytes read, 789007589 more expected)', IncompleteRead(206700544 bytes read, 789007589 more expected))
  • httpcore.RemoteProtocolError: peer closed connection without sending complete message body (received 290521088 bytes, expected 995708133)

Solution (in my case)

gunicorn has a default timeout of 30 seconds ...

so set up a bigger timeout --timeout 3600 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment