错误:读取上游时,readv()失败(104:对等连接重置) [英] Error: readv() failed (104: Connection reset by peer) while reading upstream

查看:1085
本文介绍了错误:读取上游时,readv()失败(104:对等连接重置)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有带Nginx和uwsgi的flask的facebook应用.当它从Facebook收到POST时,总是有错误:

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

但是当我直接使用GET方法访问我的应用程序时,它运行平稳.我所做的:

  1. 仅使用POST方法限制@ app.route-不起作用.
  2. 在wsgi中添加限制:uwsgi_buffer_size(如果来自Facebook的请求很大)和uwsgi_harakiri(如果uwsgi在完成请求之前提供超时)-不起作用.

我在 django 中有变通办法,但无法弄清楚尚未在烧瓶中实施.有人可以帮忙吗?

解决方案

这是uwsgi的错误.您可以从 [uWSGI]几个错误中获取更多信息. >

简单的解决方案是,即使通过POST正文为null或不需要POST参数,也必须通过wsgi.input读取POST正文.

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?

解决方案

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.

这篇关于错误:读取上游时,readv()失败(104:对等连接重置)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆