Django loading error when reading request data failed

I have a Django application that accepts orders from jQuery uploadify , a jQ plugin that uses flash to upload files and make progress bar.

Files of about 150 thousand size work, but large files always fail and almost always about 192 thousand (these 3 pieces) are completed, sometimes about 160 thousand. I get an exception below.

exceptions.IOError request data read error File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py", line 171, in _get_post self._load_post_and_files() File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py", line 137, in _load_post_and_files self._post, self._files = self.parse_file_upload(self.META, self.environ[\'wsgi.input\']) File "/usr/lib/python2.4/site-packages/django/http/__init__.py", line 124, in parse_file_upload return parser.parse() File "/usr/lib/python2.4/site-packages/django/http/multipartparser.py", line 192, in parse for chunk in field_stream: File "/usr/lib/python2.4/site-packages/django/http/multipartparser.py", line 314, in next output = self._producer.next() File "/usr/lib/python2.4/site-packages/django/http/multipartparser.py", line 468, in next for bytes in stream: File "/usr/lib/python2.4/site-packages/django/http/multipartparser.py", line 314, in next output = self._producer.next() File "/usr/lib/python2.4/site-packages/django/http/multipartparser.py", line 375, in next data = self.flo.read(self.chunk_size) File "/usr/lib/python2.4/site-packages/django/http/multipartparser.py", line 405, in read return self._file.read(num_bytes) 

When run locally, large files work on the Django development server.
I tried to set my FILE_UPLOAD_HANDLERS = ("django.core.files.uploadhandler.TemporaryFileUploadHandler",) if it was a memory load handler, but that didn't matter.

Does anyone know how to fix this?

+3
django upload uploadify
Apr 14 '10 at 23:08
source share
2 answers

The problem may be:

  • your internet connection (some firewalls block large downloads, just try downloading them to another service to check this).
  • your web browser (try disabling the flash drive to make sure it works)
  • your web server (maybe your web server forbids large downloads?)

So ... to be a little more useful, you will need to give us some information about which part of the problem (should be fairly easy to test), and if it is the web server (which I guess), which web server on which you what kind of Python handler is working (mod_wsgi, mod_python, fastcgi, etc.)

+1
Apr 14 '10 at 23:17
source share

This is common with MediaTemple - I ran into this problem, fixed it and somehow broke it again. It must deal with NFS locking and system calls used by django storage modules.

... (10 minutes later) ...

Found:

Anyone trying to run the latest version 1.1 In the svn release, it will be noted that the above fix no longer works. TemporaryFileUploaderHandler now uses a lock code. Workaround while mediatemple and / or django devs means changing django.core.files.locks and changing two calls to fcntl.lockf to fcntl.flock

Here is the corresponding error report for anyone interested: http://code.djangoproject.com/ticket/9400

http://osdir.com/ml/DjangoUsers/2009-06/msg01014.htmlhttps://forums.mediatemple.net/viewtopic.php?id=2514

+2
May 26 '10 at 3:44
source share



All Articles