#14061: MultiPartParser receives an HTTP_CONTENT_LENGTH of zero
----------------------------------+-----------------------------------------
 Reporter:  echamberlain          |       Owner:  nobody    
   Status:  new                   |   Milestone:            
Component:  File uploads/storage  |     Version:  1.2       
 Keywords:                        |       Stage:  Unreviewed
Has_patch:  0                     |  
----------------------------------+-----------------------------------------
 We have an intermittent problem when uploading files.  About one in five
 uploads fails, when the MultiPartParser receives an HTTP_CONTENT_LENGTH of
 zero.

 Is anyone else seeing this issue?

 We are running Django 1.2.1 with lighttpd 1.4.19 using fastcgi with flup
 flup-1.0.3.dev_20100525.

 {{{
 Traceback (most recent call last):

  File "/home/django/projects/talk/lib/python2.6/site-
 packages/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/home/django/projects/talk/lib/python2.6/site-
 packages/django/views/decorators/vary.py", line 22, in inner_func
    response = func(*args, **kwargs)

  File "/home/django/projects/talk/lib/python2.6/site-
 packages/django_piston-0.2.3rc1-py2.6.egg/piston/resource.py", line 142,
 in __call__
    request.data = request.POST

  File "/home/django/projects/talk/lib/python2.6/site-
 packages/django/core/handlers/wsgi.py", line 171, in _get_post
    self._load_post_and_files()

  File "/home/django/projects/talk/lib/python2.6/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 "/home/django/projects/talk/lib/python2.6/site-
 packages/django/http/__init__.py", line 123, in parse_file_upload
    parser = MultiPartParser(META, post_data, self.upload_handlers,
 self.encoding)

  File "/home/django/projects/talk/lib/python2.6/site-
 packages/django/http/multipartparser.py", line 80, in __init__
    raise MultiPartParserError("Invalid content length: %r" %
 content_length)

 MultiPartParserError: Invalid content length: 0


 <WSGIRequest
 GET:<QueryDict: {}>,
 POST:<could not parse>,
 COOKIES:{},
 META:{'CONTENT_TYPE': 'multipart/form-data; charset=utf-8;
 boundary=0xKhTmLbOuNdArY',
 'DOCUMENT_ROOT': '/home/django/projects/talk',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTPS': 'on',
 'HTTP_ACCEPT_ENCODING': 'gzip',
 'HTTP_AUTHORIZATION': 'Basic ************',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_CONTENT_LENGTH': '0',
 'HTTP_HOST': 'talk-dev.rf.com',
 'HTTP_USER_AGENT': 'RF.com 1.0 (iPhone Simulator; iPhone OS 4.0.1;
 en_US)',
 'PATH_INFO': u'/message/',
 'PATH_TRANSLATED': '/home/django/projects/talk/message/',
 'QUERY_STRING': '',
 'REDIRECT_STATUS': '200',
 'REDIRECT_URI': '/mysite.fcgi/message/',
 'REMOTE_ADDR': '67.188.41.104',
 'REMOTE_PORT': '35608',
 'REQUEST_METHOD': 'POST',
 'REQUEST_URI': '/message/',
 'SCRIPT_FILENAME': '/home/django/projects/talk/mysite.fcgi',
 'SCRIPT_NAME': u'',
 'SERVER_ADDR': '10.254.105.188',
 'SERVER_NAME': 'dev.rf.com',
 'SERVER_PORT': '443',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'lighttpd/1.4.19',
 'wsgi.errors': <flup.server.fcgi_base.TeeOutputStream object at
 0x8c7f1cc>,
 'wsgi.input': <flup.server.fcgi_base.InputStream object at 0x8c7fe2c>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'https',
 'wsgi.version': (1, 0)}>
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14061>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to