|Issue 219:||File upload limit size?|
|1 person starred this issue and may be notified of changes.||Back to list|
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/ProcessFile.py'. Traceback (most recent call last): File "/usr/local/apache2/wsgi/ProcessFile.py", line 14, in application param_hash = wsgi_config.get_request_hash(environ) File "/usr/local/apache2/wsgi/wsgi_config.py", line 19, in get_request_hash return cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ) File "/usr/lib/python2.6/cgi.py", line 508, in __init__ self.read_multi(environ, keep_blank_values, strict_parsing) File "/usr/lib/python2.6/cgi.py", line 637, in read_multi environ, keep_blank_values, strict_parsing) File "/usr/lib/python2.6/cgi.py", line 510, in __init__ self.read_single() File "/usr/lib/python2.6/cgi.py", line 647, in read_single self.read_lines() File "/usr/lib/python2.6/cgi.py", line 669, in read_lines self.read_lines_to_outerboundary() File "/usr/lib/python2.6/cgi.py", 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) else: return cgi.FieldStorage(fp=environ['QUERY_STRING'], environ=environ)
Jan 7, 2011
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.
Labels: -Type-Defect Type-Other
Jan 7, 2011
(No comment was entered for this change.)
Nov 25, 2011
No followup so assuming was the indicated issue.
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|