3

Any idea why the following error occurs when uploading image to server?!

[Tue May 21 23:44:01 2013] [error] [client 41.236.182.133] mod_wsgi (pid=9639): Exception occurred processing WSGI script '/root/AR_BROWSER/example/wsgi.py'.
[Tue May 21 23:44:01 2013] [error] [client 41.236.182.133] IOError: failed to write data

I've been googling for a long time and I can't anything helpful.

wsgi.py

import os
import sys

path = '/root/AR_BROWSER/example'

sys.path.append('/root/AR_BROWSER/example')
sys.path.append('/root/AR_BROWSER')
sys.path.append('/root/AR_BROWSER/example/app')
sys.path.append('/root/AR_BROWSER/example/static')
sys.path.append('/root/AR_BROWSER/example/static/uploaded_pics')

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

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
omarsafwany
  • 3,695
  • 8
  • 44
  • 75
  • 1
    see: http://stackoverflow.com/questions/4557920/why-is-mod-wsgi-not-able-to-write-data-ioerror-failed-to-write-data – GrantU May 21 '13 at 21:59
  • I checked that question but didn't a solution for this problem. – omarsafwany May 21 '13 at 22:03
  • Post your script if you want help. Otherwise, you could go look at the source of mod_wsgi and find the IOError that results in that error message.. There's a max upload size setting somewhere in mod_wsgi which you may be hitting. But if you grow that default, keep in mind it's not chunking http://en.wikipedia.org/wiki/Chunked_transfer_encoding, so any uploads you do are being stored in ram. 100 meg upload, +100 megs memory use in your thread. This does NOT scale very well in production on busy sites. – synthesizerpatel May 22 '13 at 08:21
  • 3
    There is no solution to the error. It is a fact of life that it happens. You can't stop a client from closing the connection. @synthesizerpatel it has nothing to do with max upload size. If you were using LimitRequestBody directive in Apache it wouldn't even get through to the WSGI application as it would be blocked with a 413 error. Anyway, the error is for the writing of the response, not reading the request content. – Graham Dumpleton May 23 '13 at 10:26
  • @GrahamDumpleton you mean no way this can be solved or what?! – omarsafwany May 23 '13 at 15:00
  • It is a communication error caused by something outside of your control. How are you going to solve that? The message is effectively information only in that context. – Graham Dumpleton May 23 '13 at 21:14

0 Answers0