为什么mod_wsgi无法写入数据? IOError:无法写入数据 [英] Why is mod_wsgi not able to write data? IOError: failed to write data

查看:597
本文介绍了为什么mod_wsgi无法写入数据? IOError:无法写入数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能导致此错误:

$ sudo tail -n 100 /var/log/apache2/error.log'

$ sudo tail -n 100 /var/log/apache2/error.log'

[Wed Dec 29 15:20:03 2010] [error] [client 220.181.108.181] mod_wsgi (pid=20343): Exception occurred processing WSGI script '/home/username/public_html/idm.wsgi'.  
[Wed Dec 29 15:20:03 2010] [error] [client 220.181.108.181] IOError: failed to write data  

这是WSGI脚本:

$ cat public_html/idm.wsgi 
import os
import sys

sys.path.append('/home/username/public_html/IDM_app/')

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()

为什么Django无法写入数据?

Why would Django not be able to write data?

我正在运行Django 1.2.4

I'm running Django 1.2.4

推荐答案

这个错误,没有任何类型的Python追溯可能是一个问题的变体,描述如下:

That error, without any sort of Python traceback, may be a variation on issue described in:

http:// code。 google.com/p/modwsgi/issues/detail?id=29&can=1

就是发生在HTTP客户端连接丢失之前福Web服务器可以写回应用程序。它可以在Apache错误日志中显示为客户端关闭连接,无法写入数据或无法刷新数据IOError。也就是说,WSGI应用程序没有看到,因为在WSGI应用程序返回后发生数据的写入,所以不能将异常返回到应用程序来执行任何操作。

That is, occurs when HTTP client connection is lost before the full response could be written back by the web server. It can manifest as 'client closed connection', 'failed to write data' or 'failed to flush data' IOError in Apache error log only. Ie., not seen by WSGI applicaton because the writing of data is occurring after WSGI application has returned and so can't throw exception back to the application to do anything with.

问题是您是否收到Django的错误消息,如果你配置错误发送给您的电子邮件。如果你这样做,那么Django就会发生什么。

The question is whether you get an error message from Django if you configure errors to be sent to you in email. If you do, then instead is something happening in Django.

这篇关于为什么mod_wsgi无法写入数据? IOError:无法写入数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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