Timeout on submissions

With formhub when people submit photos over a slower connection we're
getting a 500 error on submissions. Mostly likely we think it's due to a
connection time out.

We were wondering how you handled this with Aggregate or if this is an
error ODK collect users will experience given similar circumstances?

Just wondering if you had any advice as we dig into this.

Thanks,

Matt

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/core/handlers/base.py",
line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/views/decorators/http.py",
line 45, in inner
return func(request, *args, **kwargs)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/views/decorators/csrf.py",
line 39, in wrapped_view
resp = view_func(*args, **kwargs)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/views/decorators/csrf.py",
line 52, in wrapped_view
return view_func(*args, **kwargs)

File "/home/wsgi/srv/ei_surveyor_alpha/formhub/odk_logger/views.py", line
75, in submission
xml_file_list = request.FILES.pop("xml_submission_file", )

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/core/handlers/wsgi.py",
line 226, in _get_files
self._load_post_and_files()

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/init.py",
line 272, in _load_post_and_files
self._post, self._files = self.parse_file_upload(self.META, self)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/init.py",
line 234, in parse_file_upload
return parser.parse()

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 192, in parse
for chunk in field_stream:

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 314, in next
output = self._producer.next()

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 468, in next
for bytes in stream:

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 314, in next
output = self._producer.next()

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 375, in next
data = self.flo.read(self.chunk_size)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 405, in read
return self._file.read(num_bytes)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/init.py",
line 296, in read
return self._stream.read(*args, **kwargs)

IOError: request data read error

<WSGIRequest
GET:<QueryDict: {}>,
POST:,
COOKIES:{},
META:{'CONTENT_LENGTH': '6355267',
'CONTENT_TYPE': 'multipart/form-data;
boundary=mwroxo5jQ8TAPFdswHfBIaX8tnIHSwhc',
'CSRF_COOKIE': '445289f214e66cb08f4626b88946c44c',
'DOCUMENT_ROOT': '/htdocs',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTP_CONNECTION': 'Close',
'HTTP_DATE': 'mar, 17 janv. 2012 10:54:49 UTC+00:00',
'HTTP_HOST': 'formhub.org',
'HTTP_X_FORWARDED_FOR': '67.45.25.234',
'HTTP_X_OPENROSA_VERSION': '1.0',
'PATH':
'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin',
'PATH_INFO': u'/vte_mercycorps/submission',
'PATH_TRANSLATED':
'/home/wsgi/srv/ei_surveyor_alpha/apache/environment.wsgi/vte_mercycorps/submission',
'QUERY_STRING': '',
'REMOTE_ADDR': '69.19.14.40',
'REMOTE_PORT': '34529',
'REQUEST_METHOD': 'POST',
'REQUEST_URI': '/vte_mercycorps/submission',
'SCRIPT_FILENAME':
'/home/wsgi/srv/ei_surveyor_alpha/apache/environment.wsgi',
'SCRIPT_NAME': u'',
'SERVER_ADDR': '173.255.225.171',
'SERVER_ADMIN': 'support@formhub.org',
'SERVER_NAME': 'formhub.org',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.1',
'SERVER_SIGNATURE': 'Apache/2.2.14 (Ubuntu) Server at
formhub.org Port
80\n',
'SERVER_SOFTWARE': 'Apache/2.2.14 (Ubuntu)',
'mod_wsgi.application_group': 'ei-surveyor.mvpafrica.org|',
'mod_wsgi.callable_object': 'application',
'mod_wsgi.listener_host': '',
'mod_wsgi.listener_port': '80',
'mod_wsgi.process_group': 'ei-surveyor.mvpafrica.org',
'mod_wsgi.reload_mechanism': '1',
'mod_wsgi.script_reloading': '1',
'mod_wsgi.version': (2, 8),
'wsgi.errors': <mod_wsgi.Log object at 0xb9140a40>,
'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter
object at 0xb91394a0>,
'wsgi.input': <mod_wsgi.Input object at 0xb914b4d0>,
'wsgi.multiprocess': True,
'wsgi.multithread': True,
'wsgi.run_once': False,
'wsgi.url_scheme': 'http',
'wsgi.version': (1, 0)}>

AppEngine puts a limit of 60 seconds on a submission attempt. ODK
Aggregate will also experience a 500 error code over a slow connection.
ODK Collect limits the size of a submission to about 10 MB to both help
limit the VM requirements on the server and to bound the transmission
time. But if your transmission rate is less than 1.3 Mbit/sec, you will
likely get a 500 during a 10MB upload. Note that the OpenRosa standard
defines an X-OpenRosa-Accept-Content-Length that could be used to inform
the client to change the transmission size to something other than 10MB.
We don't yet support that. Once we do, it might be a server preferences
setting that could be used to knock down the max transmission size.

This isn't so much of an issue when running on Tomcat. The Tomcat
configurations are described in
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html As far as I can
tell, we have a 10-minutes request timeout on Tomcat. If, however, you run
Tomcat behind an Apache instance, you will also have fairly short timeouts
by default on Apache and will need to configure the Apache webserver with a
longer timeout.

In general, the web server container (e.g., Tomcat, Jetty) establishes the
timeout thresholds for a request.

The

··· On Tue, Jan 17, 2012 at 3:12 PM, Matt Berg wrote:

With formhub when people submit photos over a slower connection we're
getting a 500 error on submissions. Mostly likely we think it's due to a
connection time out.

We were wondering how you handled this with Aggregate or if this is an
error ODK collect users will experience given similar circumstances?

Just wondering if you had any advice as we dig into this.

Thanks,

Matt

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/core/handlers/base.py",
line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/views/decorators/http.py",
line 45, in inner
return func(request, *args, **kwargs)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/views/decorators/csrf.py",
line 39, in wrapped_view
resp = view_func(*args, **kwargs)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/views/decorators/csrf.py",
line 52, in wrapped_view
return view_func(*args, **kwargs)

File "/home/wsgi/srv/ei_surveyor_alpha/formhub/odk_logger/views.py", line
75, in submission
xml_file_list = request.FILES.pop("xml_submission_file", )

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/core/handlers/wsgi.py",
line 226, in _get_files
self._load_post_and_files()

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/init.py",
line 272, in _load_post_and_files
self._post, self._files = self.parse_file_upload(self.META, self)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/init.py",
line 234, in parse_file_upload
return parser.parse()

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 192, in parse
for chunk in field_stream:

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 314, in next
output = self._producer.next()

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 468, in next
for bytes in stream:

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 314, in next
output = self._producer.next()

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 375, in next
data = self.flo.read(self.chunk_size)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 405, in read
return self._file.read(num_bytes)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/init.py",
line 296, in read
return self._stream.read(*args, **kwargs)

IOError: request data read error

<WSGIRequest
GET:<QueryDict: {}>,
POST:,
COOKIES:{},
META:{'CONTENT_LENGTH': '6355267',
'CONTENT_TYPE': 'multipart/form-data;
boundary=mwroxo5jQ8TAPFdswHfBIaX8tnIHSwhc',
'CSRF_COOKIE': '445289f214e66cb08f4626b88946c44c',
'DOCUMENT_ROOT': '/htdocs',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTP_CONNECTION': 'Close',
'HTTP_DATE': 'mar, 17 janv. 2012 10:54:49 UTC+00:00',
'HTTP_HOST': 'formhub.org',
'HTTP_X_FORWARDED_FOR': '67.45.25.234',
'HTTP_X_OPENROSA_VERSION': '1.0',
'PATH':
'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin',
'PATH_INFO': u'/vte_mercycorps/submission',
'PATH_TRANSLATED':
'/home/wsgi/srv/ei_surveyor_alpha/apache/environment.wsgi/vte_mercycorps/submission',
'QUERY_STRING': '',
'REMOTE_ADDR': '69.19.14.40',
'REMOTE_PORT': '34529',
'REQUEST_METHOD': 'POST',
'REQUEST_URI': '/vte_mercycorps/submission',
'SCRIPT_FILENAME':
'/home/wsgi/srv/ei_surveyor_alpha/apache/environment.wsgi',
'SCRIPT_NAME': u'',
'SERVER_ADDR': '173.255.225.171',
'SERVER_ADMIN': 'support@formhub.org',
'SERVER_NAME': 'formhub.org',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.1',
'SERVER_SIGNATURE': 'Apache/2.2.14 (Ubuntu) Server at
formhub.org Port 80\n',
'SERVER_SOFTWARE': 'Apache/2.2.14 (Ubuntu)',
'mod_wsgi.application_group': 'ei-surveyor.mvpafrica.org|',
'mod_wsgi.callable_object': 'application',
'mod_wsgi.listener_host': '',
'mod_wsgi.listener_port': '80',
'mod_wsgi.process_group': 'ei-surveyor.mvpafrica.org',
'mod_wsgi.reload_mechanism': '1',
'mod_wsgi.script_reloading': '1',
'mod_wsgi.version': (2, 8),
'wsgi.errors': <mod_wsgi.Log object at 0xb9140a40>,
'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter
object at 0xb91394a0>,
'wsgi.input': <mod_wsgi.Input object at 0xb914b4d0>,
'wsgi.multiprocess': True,
'wsgi.multithread': True,
'wsgi.run_once': False,
'wsgi.url_scheme': 'http',
'wsgi.version': (1, 0)}>

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Thanks Mitch this is extremely helpful!

··· On Tuesday, January 17, 2012, Mitch S wrote:

AppEngine puts a limit of 60 seconds on a submission attempt. ODK
Aggregate will also experience a 500 error code over a slow connection.
ODK Collect limits the size of a submission to about 10 MB to both help
limit the VM requirements on the server and to bound the transmission
time. But if your transmission rate is less than 1.3 Mbit/sec, you will
likely get a 500 during a 10MB upload. Note that the OpenRosa standard
defines an X-OpenRosa-Accept-Content-Length that could be used to inform
the client to change the transmission size to something other than 10MB.
We don't yet support that. Once we do, it might be a server preferences
setting that could be used to knock down the max transmission size.

This isn't so much of an issue when running on Tomcat. The Tomcat
configurations are described in
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html As far as I can
tell, we have a 10-minutes request timeout on Tomcat. If, however, you run
Tomcat behind an Apache instance, you will also have fairly short timeouts
by default on Apache and will need to configure the Apache webserver with a
longer timeout.

In general, the web server container (e.g., Tomcat, Jetty) establishes the
timeout thresholds for a request.

The

On Tue, Jan 17, 2012 at 3:12 PM, Matt Berg mlberg@gmail.com wrote:

With formhub when people submit photos over a slower connection we're
getting a 500 error on submissions. Mostly likely we think it's due to a
connection time out.

We were wondering how you handled this with Aggregate or if this is an
error ODK collect users will experience given similar circumstances?

Just wondering if you had any advice as we dig into this.

Thanks,

Matt

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/core/handlers/base.py",
line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/views/decorators/http.py",
line 45, in inner
return func(request, *args, **kwargs)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/views/decorators/csrf.py",
line 39, in wrapped_view
resp = view_func(*args, **kwargs)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/views/decorators/csrf.py",
line 52, in wrapped_view
return view_func(*args, **kwargs)

File "/home/wsgi/srv/ei_surveyor_alpha/formhub/odk_logger/views.py", line
75, in submission
xml_file_list = request.FILES.pop("xml_submission_file", )

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/core/handlers/wsgi.py",
line 226, in _get_files
self._load_post_and_files()

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/init.py",
line 272, in _load_post_and_files
self._post, self._files = self.parse_file_upload(self.META, self)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/init.py",
line 234, in parse_file_upload
return parser.parse()

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 192, in parse
for chunk in field_stream:

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 314, in next
output = self._producer.next()

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 468, in next
for bytes in stream:

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 314, in next
output = self._producer.next()

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 375, in next
data = self.flo.read(self.chunk_size)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/multipartparser.py",
line 405, in read
return self._file.read(num_bytes)

File
"/home/wsgi/srv/ei_surveyor_alpha/project_env/lib/python2.6/site-packages/django/http/init.py",
line 296, in read
return self._stream.read(*args, **kwargs)

IOError: request data read error

<WSGIRequest
GET:<QueryDict: {}>,
POST:,
COOKIES:{},
META:{'CONTENT_LENGTH': '6355267',
'CONTENT_TYPE': 'multipart/form-data;
boundary=mwroxo5jQ8TAPFdswHfBIaX8tnIHSwhc',
'CSRF_COOKIE': '445289f214e66cb08f4626b88946c44c',
'DOCUMENT_ROOT': '/htdocs',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTP_CONNECTION': 'Close',
'HTTP_DATE':

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com <javascript:_e({}, 'cvml',
'mitchellsundt@gmail.com');>