Friday, January 31, 2014

UnreadablePostError: request data read error

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQEcBAEBCgAGBQJS7CoUAAoJELMiOgVOfjkQby4IALhygRBbLkwx967zpowqOmXc
z7FK1KNZwL6bh4c6yfGaJBaBDJu3q6ecSOm1O/LHygrVB17IDD2flCBgeXW5QEO8
4cp0vlk/KZmNVz/JMERWCfEtL+eMfwmZb238p/sSq+b5nxWNHxeg8841csqz7RwY
DOnoZUJ7FEQr7ZTvZu/U0yASgVQFZSWBskjHTRA3VyPJ/tCoA2F3RSvEMWwKfNcl
SJ5EJ/z3YdBWdHXUq2RFVKyLZqmY4WsDYc9WBQLIK1Frc3mkD2U744NnSLZBNc/p
NTtNGSKFV4c+9goNVNwBqadYeeAxOXbFlkAY6y53HdrqtemJsbaDMaRHU7yuBW8=
=44u1
-----END PGP SIGNATURE-----
Hi

I am getting the error below when users are uploading files to a website, this is on django 1.6.1.

What this suggests is that the client is closing the connection before the file is fully uploaded, ie the data cannot be read to completion.

This is happening with different browsers and seemingly on a random basis.

What I want to know is (a) am I reading this right and (b) what I can do to pin down this issue?

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 107, in get_response
response = middleware_method(request, callback, callback_args, callback_kwargs)
File "/usr/lib/python2.6/site-packages/django/middleware/csrf.py", line 170, in process_view
request_csrf_token = request.POST.get('csrfmiddlewaretoken', '')
File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 146, in _get_post
self._load_post_and_files()
File "/usr/lib/python2.6/site-packages/django/http/request.py", line 219, in _load_post_and_files
self._post, self._files = self.parse_file_upload(self.META, data)
File "/usr/lib/python2.6/site-packages/django/http/request.py", line 184, in parse_file_upload
return parser.parse()
File "/usr/lib/python2.6/site-packages/django/http/multipartparser.py", line 201, in parse
for chunk in field_stream:
File "/usr/lib/python2.6/site-packages/django/utils/six.py", line 414, in next
return type(self).__next__(self)
File "/usr/lib/python2.6/site-packages/django/http/multipartparser.py", line 330, in __next__
output = next(self._producer)
File "/usr/lib/python2.6/site-packages/django/utils/six.py", line 414, in next
return type(self).__next__(self)
File "/usr/lib/python2.6/site-packages/django/http/multipartparser.py", line 458, in __next__
for bytes in stream:
File "/usr/lib/python2.6/site-packages/django/utils/six.py", line 414, in next
return type(self).__next__(self)
File "/usr/lib/python2.6/site-packages/django/http/multipartparser.py", line 330, in __next__
output = next(self._producer)
File "/usr/lib/python2.6/site-packages/django/utils/six.py", line 414, in next
return type(self).__next__(self)
File "/usr/lib/python2.6/site-packages/django/http/multipartparser.py", line 391, in __next__
data = self.flo.read(self.chunk_size)
File "/usr/lib/python2.6/site-packages/django/http/request.py", line 248, in read
six.reraise(UnreadablePostError, UnreadablePostError(*e.args), sys.exc_info()[2])
File "/usr/lib/python2.6/site-packages/django/http/request.py", line 246, in read
return self._stream.read(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 51, in read
result = self.buffer + self._read_limited(size - len(self.buffer))
File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 39, in _read_limited
result = self.stream.read(size)
UnreadablePostError: request data read error


Thanks

François

No comments:

Post a Comment