Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
309 views
in Technique[技术] by (71.8m points)

django - Why is mod_wsgi not able to write data? IOError: failed to write data

What could be causing this error:

$ 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  

Here is the WSGI script:

$ 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()

Why would Django not be able to write data?

I'm running Django 1.2.4

question from:https://stackoverflow.com/questions/4557920/why-is-mod-wsgi-not-able-to-write-data-ioerror-failed-to-write-data

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...