Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnreadablePostError at /[username]/submission #847

Closed
ukanga opened this issue Nov 24, 2016 · 0 comments
Closed

UnreadablePostError at /[username]/submission #847

ukanga opened this issue Nov 24, 2016 · 0 comments

Comments

@ukanga
Copy link
Member

ukanga commented Nov 24, 2016

UnreadablePostError at /[username]/submission
error during read(65536) on wsgi.input

Request Method: POST
Request URL: https://ona.io/[username]/submission
Django Version: 1.9.5
Python Executable: /.../.virtualenvs/onadata/bin/uwsgi
Python Version: 2.7.6
Python Path: ['/.../.virtualenvs/onadata/src/savreaderwriter/savReaderWriter', '/.../.virtualenvs/onadata/src/savreaderwriter/savReaderWriter/cWriterow', '.', '', '/.../.virtualenvs/onadata/src/django-nose', '/.../.virtualenvs/onadata/src/django-digest', '/.../.virtualenvs/onadata/src/j2xclient', '/.../.virtualenvs/onadata/src/cors-headers', '/.../.virtualenvs/onadata/src/pricing', '/.../.virtualenvs/onadata/src/savreaderwriter', '/.../.virtualenvs/onadata/src/google-export', '/.../.virtualenvs/onadata/lib/python2.7', '/.../.virtualenvs/onadata/lib/python2.7/plat-x86_64-linux-gnu', '/.../.virtualenvs/onadata/lib/python2.7/lib-tk', '/.../.virtualenvs/onadata/lib/python2.7/lib-old', '/.../.virtualenvs/onadata/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/.../.virtualenvs/onadata/local/lib/python2.7/site-packages']
Server time: Thu, 24 Nov 2016 03:38:50 -0500
Installed Applications:
('google_export',
 'pricing',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.gis',
 'registration',
 'django_nose',
 'django_digest',
 'corsheaders',
 'oauth2_provider',
 'rest_framework',
 'rest_framework.authtoken',
 'taggit',
 'readonly',
 'onadata.apps.logger',
 'onadata.apps.viewer',
 'onadata.apps.main',
 'onadata.apps.restservice',
 'onadata.apps.api',
 'guardian',
 'djcelery',
 'onadata.apps.sms_support',
 'onadata.libs',
 'reversion')
Installed Middleware:
('onadata.libs.profiling.sql.SqlTimingMiddleware',
 'django.middleware.http.ConditionalGetMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'onadata.libs.utils.middleware.LocaleMiddlewareWithTweaks',
 'django.middleware.csrf.CsrfViewMiddleware',
 'corsheaders.middleware.CorsMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'onadata.libs.utils.middleware.HTTPResponseNotAllowedMiddleware',
 'readonly.middleware.DatabaseReadOnlyMiddleware')


Traceback:

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  149.                     response = self.process_exception_by_middleware(e, request)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  147.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/views/decorators/csrf.py" in wrapped_view
  58.         return view_func(*args, **kwargs)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/rest_framework/viewsets.py" in view
  87.             return self.dispatch(request, *args, **kwargs)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/rest_framework/views.py" in dispatch
  466.             response = self.handle_exception(exc)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/rest_framework/views.py" in dispatch
  463.             response = handler(request, *args, **kwargs)

File "./onadata/apps/api/viewsets/xform_submission_viewset.py" in create
  149.             error, instance = create_fn(username, request)

File "./onadata/apps/api/viewsets/xform_submission_viewset.py" in create_instance_from_xml
  75.     xml_file_list = request.FILES.pop('xml_submission_file', [])

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/rest_framework/request.py" in __getattribute__
  353.             return super(Request, self).__getattribute__(attr)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/rest_framework/request.py" in FILES
  383.             self._load_data_and_files()

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/rest_framework/request.py" in _load_data_and_files
  243.             self._data, self._files = self._parse()

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/rest_framework/request.py" in _parse
  289.             parsed = parser.parse(stream, media_type, self.parser_context)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/rest_framework/parsers.py" in parse
  114.             data, files = parser.parse()

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/http/multipartparser.py" in parse
  209.                         for chunk in field_stream:

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/utils/six.py" in next
  558.             return type(self).__next__(self)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/http/multipartparser.py" in __next__
  356.             output = next(self._producer)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/utils/six.py" in next
  558.             return type(self).__next__(self)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/http/multipartparser.py" in __next__
  487.         for bytes in stream:

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/utils/six.py" in next
  558.             return type(self).__next__(self)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/http/multipartparser.py" in __next__
  356.             output = next(self._producer)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/utils/six.py" in next
  558.             return type(self).__next__(self)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/http/multipartparser.py" in __next__
  418.             data = self.flo.read(self.chunk_size)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/http/request.py" in read
  322.             six.reraise(UnreadablePostError, UnreadablePostError(*e.args), sys.exc_info()[2])

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/http/request.py" in read
  320.             return self._stream.read(*args, **kwargs)

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py" in read
  53.             result = self.buffer + self._read_limited(size - len(self.buffer))

File "/.../.virtualenvs/onadata/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py" in _read_limited
  41.         result = self.stream.read(size)

Exception Type: UnreadablePostError at /[username]/submission
Exception Value: error during read(65536) on wsgi.input
Request information:
GET: No GET data

POST: No POST data

FILES: No FILES data

COOKIES: No cookie data

Aha! Link: https://ona.aha.io/features/PROD-654

@ukanga ukanga self-assigned this Nov 24, 2016
@pld pld added the Has-PR label Nov 24, 2016
@ukanga ukanga closed this as completed in 5a72135 Nov 24, 2016
ukanga added a commit that referenced this issue Nov 24, 2016
handle UnreadablePostError exceptions on submissions, closes #847
@ukanga ukanga reopened this Oct 24, 2017
@ukanga ukanga removed the Has-PR label Oct 24, 2017
@ukanga ukanga added this to the Week 42 - 43 milestone Oct 24, 2017
@ukanga ukanga modified the milestones: Week 42 - 43, Week 44 - 45 Nov 6, 2017
@ukanga ukanga modified the milestones: Week 44 - 47, Week 48 - 49 Dec 4, 2017
@ukanga ukanga modified the milestones: Week 48 - 52, Week 1 - 2 Jan 2, 2018
@ukanga ukanga modified the milestones: Week 1 - 2, Week 3 - 4 Jan 15, 2018
@ukanga ukanga added this to the Week 25 - 26 (2018) milestone Jun 20, 2018
ukanga added a commit that referenced this issue Jun 20, 2018
Returns a 400 HTTP status code instead of a 500 HTTP status.

Fix #847
@ukanga ukanga closed this as completed in 62d752e Jun 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants