Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: readv() failed (104: Connection reset by peer) while reading upstream

I have facebook apps with flask with nginx and uwsgi. When it receive POST from facebook, it always has error:

readv() failed (104: Connection reset by peer) while reading upstream

But when I access my apps directly (with GET method), it ran smoothly. What I've done:

  1. Limit @app.route with POST method only - doesn't work.
  2. Add limit in wsgi: uwsgi_buffer_size (in case request from facebook is big), and uwsgi_harakiri (in case uwsgi provide timeout before finish it request) - doesn't work.

I have workaround in django but can't figure out yet how to implement in flask. Could anyone help please?

like image 363
asofyan Avatar asked May 01 '12 03:05

asofyan


1 Answers

This is the bug of uwsgi. You can get more from [uWSGI] Several bugs .

The simple solution is that you must read the POST body by wsgi.input, even through POST body is null or you don't need POST params.

like image 176
Yang Juven Avatar answered Sep 28 '22 16:09

Yang Juven