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

I have facebook apps with jar with nginx and uwsgi. When it gets POST from facebook, it always has an error:

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

But when I directly access my applications (using the GET method), it works smoothly. What I've done:

  • Only Limit @ app.route with the POST method does not work.
  • Add a restriction to wsgi: uwsgi_buffer_size (if the request from facebook is large) and uwsgi_harakiri (if uwsgi provides a timeout before the request is completed) - does not work.

I have a workaround in django , but so far I can’t figure out how to implement it in a bulb. Can anyone help?

+8
post flask wsgi dotcloud
source share
2 answers

This is uwsgi error. You can get more from [uWSGI] A few bugs .

A simple solution is that you have to read the POST body with wsgi.input, even through the POST body, or you do not need the POST parameters.

+2
source share

The problem is that the upstream (the actual process in which nginx is a proxy server) closes the connection.

In my case, Django is my web server, and I needed to set DATA_UPLOAD_MAX_NUMBER_FIELDS more, because there were too many fields in the POST request.

0
source share

All Articles