I've had the same problem, and can't figure out how to resolve it.  It
seems to have nothing to do with the amount of data being transfered:
it happens occasionally on the smallest of page requests/responses.
It also doesn't seem to be related to browser, unless several
different versions of IE *and* Safari have the same problem.  I tried
disabling keepalives for Safari at least, and it doesn't seem to have
helped.  I'd prefer not to disable keepalives in general, if I can
avoid it.

All of the error messages I've received have shown in the traceback
that they're coming through this function:
http://code.djangoproject.com/browser/django/trunk/django/core/handlers/wsgi.py#L131

It seems to me like there's an easy workaround (I'm sure the actual
fix has to be much lower level, in WSGI or Apache [or even lower])
that would at least stop my users from getting 500 errors: wrap the
contents of that function in a try block, and *don't* raise the
exception.

Otherwise, I'd have to wrap every view that uses POST in that, which
would be very annoying.  Or maybe write middleware that just peeks at
POST before anything else gets it, so that I could catch it there.

Thoughts?

Thanks,
Jeff

On Mar 31, 6:40 pm, Graham Dumpleton <graham.dumple...@gmail.com>
wrote:
> On Apr 1, 1:34 am, akaihola <akaih...@gmail.com> wrote:
>
> > We ran into the same issue Chunlei Wu described in January[1]. A user
> > was trying to upload large files and all we got were 500 errors by e-
> > mail:
>
> >   File "/home/citedesarts/src/django/django/http/multipartparser.py",
> > line 406, inread
> >IOError:requestdatareaderror
>
> > The user was on a public library computer with IE7. We're running
> > Apache 2.2.9 andmod_wsgi2.3 as packaged in Debian 5.0 Lenny.
>
> > I'm wondering about the HTTP_VIA header, could that have contributed
> > to the problem?
>
> The presence of the header itself is not likely to cause the issue,
> but its presence does indicate that therequestwent via a proxy or
> other sort of software. That proxy may have been killing off requests
> which took too long.
>
> The basic problem remains that the connection to the HTTP server was
> dropped before alldatacould beread.
>
> Graham
>
> > [1]http://groups.google.fi/group/django-users/browse_thread/thread/
> > 946936f69c012d96
>
> > ----
>
> > Below is the WSGIRequest dump from the 500 e-mail:
>
> > <WSGIRequest
> > GET:<QueryDict: {}>,
> > POST:<could not parse>,
> > COOKIES:{'sessionid': '83bc617fed936487b17f7d14848d245c'},
> > META:{'CONTENT_LENGTH': '30977474',
> >  'CONTENT_TYPE': 'multipart/form-data;
> > boundary=---------------------------7d9c0903da',
> >  'DOCUMENT_ROOT': '/home/mysite/media',
> >  'GATEWAY_INTERFACE': 'CGI/1.1',
> >  'HTTP_ACCEPT': 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> > application/x-shockwave-flash, application/vnd.ms-excel, application/
> > vnd.ms-powerpoint, application/msword, */*',
> >  'HTTP_ACCEPT_LANGUAGE': 'fi',
> >  'HTTP_CACHE_CONTROL': 'no-cache',
> >  'HTTP_CONNECTION': 'Keep-Alive',
> >  'HTTP_COOKIE': 'sessionid=83bc617fed936487b17f7d14848d245c',
> >  'HTTP_HOST': 'mysite.com',
> >  'HTTP_REFERER': 'http://mysite.com/myform/',
> >  'HTTP_UA_CPU': 'x86',
> >  'HTTP_USER_AGENT': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT
> > 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
> >  'HTTP_VIA': '1.1 EDUISAIMA',
> >  'PATH': '/usr/local/bin:/usr/bin:/bin',
> >  'PATH_INFO': u'/myform/',
> >  'PATH_TRANSLATED': '/home/mysite/deploy/mysite/myform/',
> >  'QUERY_STRING': '',
> >  'REMOTE_ADDR': '194.xxx.xxx.xxx',
> >  'REMOTE_PORT': '26205',
> >  'REQUEST_METHOD': 'POST',
> >  'REQUEST_URI': '/myform/',
> >  'SCRIPT_FILENAME': '/home/mysite/deploy/mysite.wsgi',
> >  'SCRIPT_NAME': u'',
> >  'SERVER_ADDR': '78.xxx.xxx.xxx',
> >  'SERVER_ADMIN': 'ad...@mysine.com',
> >  'SERVER_NAME': 'mysite.com',
> >  'SERVER_PORT': '80',
> >  'SERVER_PROTOCOL': 'HTTP/1.1',
> >  'SERVER_SIGNATURE': '<address>Apache/2.2.9 (Debian)mod_wsgi/2.3
> > Python/2.5.2 Server at mysite.com Port 80</address>\n',
> >  'SERVER_SOFTWARE': 'Apache/2.2.9 (Debian)mod_wsgi/2.3 Python/2.5.2',
> >  'mod_wsgi.application_group': 'mysite.com|',
> >  'mod_wsgi.callable_object': 'application',
> >  'mod_wsgi.listener_host': '',
> >  'mod_wsgi.listener_port': '80',
> >  'mod_wsgi.process_group': 'mysite',
> >  'mod_wsgi.reload_mechanism': '1',
> >  'mod_wsgi.script_reloading': '1',
> >  'wsgi.errors': <mod_wsgi.Log object at 0x2c3df90>,
> >  'wsgi.file_wrapper': <built-in method file_wrapper ofmod_wsgi.Adapter 
> > object at 0x24aeeb8>,
> >  'wsgi.input': <mod_wsgi.Input object at 0x2fb98f0>,
> >  'wsgi.multiprocess': True,
> >  'wsgi.multithread': True,
> >  'wsgi.run_once': False,
> >  'wsgi.url_scheme': 'http',
> >  'wsgi.version': (1, 0)}>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to