My favorites | Sign in
Project Home Downloads Wiki
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 219: File upload limit size?
1 person starred this issue and may be notified of changes. Back to list
Status:  WontFix
Closed:  Nov 2011

Sign in to add a comment
Reported by, Jan 7, 2011
I got the following stacktrace while handling a file upload request.

Unfortunately, I don't know which file the user was attempting to upload, so I am only speculating about the size being the problem, but I do know that the same code works without problems for files that are 10 mb or less.

I'm using the latest version (3.3) built from source, on ubuntu 10.10.

Here's the stacktrace:

 mod_wsgi (pid=9804): Exception occurred processing WSGI script '/usr/local/apache2/wsgi/'.
 Traceback (most recent call last):
   File "/usr/local/apache2/wsgi/", line 14, in application
     param_hash = wsgi_config.get_request_hash(environ)
   File "/usr/local/apache2/wsgi/", line 19, in get_request_hash
     return cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ)
   File "/usr/lib/python2.6/", line 508, in __init__
     self.read_multi(environ, keep_blank_values, strict_parsing)
   File "/usr/lib/python2.6/", line 637, in read_multi
     environ, keep_blank_values, strict_parsing)
   File "/usr/lib/python2.6/", line 510, in __init__
   File "/usr/lib/python2.6/", line 647, in read_single
   File "/usr/lib/python2.6/", line 669, in read_lines
   File "/usr/lib/python2.6/", line 697, in read_lines_to_outerboundary
     line = self.fp.readline(1<<16)
 IOError: request data read error

And here's the block of code which triggered it:

import cgi

def get_request_hash (environ):
    """Return a hash of the requests: key=param name, value=list of values for that parameter"""
    if environ['REQUEST_METHOD'] == 'POST':
        return cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ)
        return cgi.FieldStorage(fp=environ['QUERY_STRING'], environ=environ)

Jan 7, 2011
Project Member #1
That error will arise when the socket connection back to the client was closed prior to all request content having been read from the request. It is not indicative of an application of Apache/mod_wsgi issue and usually just means that the user got impatient and aborted the upload or there was some transient network issue in between that caused connection to be dropped. In the latter case, depending on how long upload took, some proxies will cut off the connection if configured with quite aggressive connection timeouts.
Cc: Graham.Dumpleton
Labels: -Type-Defect Type-Other
Jan 7, 2011
Project Member #2
(No comment was entered for this change.)
Owner: Graham.Dumpleton
Cc: -Graham.Dumpleton
Nov 25, 2011
Project Member #3
No followup so assuming was the indicated issue.
Status: WontFix
Nov 28, 2011
It still occurs from time to time, but it's clearly nothing to do with mod_wsgi -- large file + weak/intermittent client connection seems to be the cause.
Sign in to add a comment

Powered by Google Project Hosting