ramkrishanbhatt / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

File upload limit size? #219

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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)

Original issue reported on code.google.com by denis.pa...@gmail.com on 7 Jan 2011 at 3:03

GoogleCodeExporter commented 8 years ago
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.

Original comment by Graham.Dumpleton@gmail.com on 8 Jan 2011 at 12:04

GoogleCodeExporter commented 8 years ago

Original comment by Graham.Dumpleton@gmail.com on 8 Jan 2011 at 12:07

GoogleCodeExporter commented 8 years ago
No followup so assuming was the indicated issue.

Original comment by Graham.Dumpleton@gmail.com on 26 Nov 2011 at 6:30

GoogleCodeExporter commented 8 years ago
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.

Original comment by denis.pa...@gmail.com on 28 Nov 2011 at 5:23