hltcoe / turkle

Django-based clone of Amazon's Mechanical Turk service running in your local environment.
https://turkle.readthedocs.io
Other
147 stars 47 forks source link

Serving an empty file causes gunicorn to crash #153

Closed cash closed 2 years ago

cash commented 2 years ago

Hit the index page (forcing a refresh) while running a logger on the docker container (docker logs -f [container name])

[2022-02-02 20:32:42 -0500] [26] [ERROR] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/gunicorn/workers/sync.py", line 182, in handle_request
    resp.write_file(respiter)
  File "/usr/local/lib/python3.9/site-packages/gunicorn/http/wsgi.py", line 385, in write_file
    if not self.sendfile(respiter):
  File "/usr/local/lib/python3.9/site-packages/gunicorn/http/wsgi.py", line 375, in sendfile
    self.sock.sendfile(respiter.filelike, count=nbytes)
  File "/usr/local/lib/python3.9/socket.py", line 483, in sendfile
    return self._sendfile_use_sendfile(file, offset, count)
  File "/usr/local/lib/python3.9/socket.py", line 347, in _sendfile_use_sendfile
    self._check_sendfile_params(file, offset, count)
  File "/usr/local/lib/python3.9/socket.py", line 461, in _check_sendfile_params
    raise ValueError(
ValueError: count must be a positive integer (got 0)

Relevant stackoverflow link: https://stackoverflow.com/questions/68219233/run-flask-with-gunicorn-got-error-handling-request-count-must-be-a-positive-in

This is with gunicorn 20.1.0

cash commented 2 years ago

This has probably been happening for a long time and is due to serving an empty favicon