#27820: response_for_exception triggers 500 when exc is RequestDataTooBig
-------------------------------------+-------------------------------------
               Reporter:  Amalia     |          Owner:  nobody
  Souček                             |
                   Type:  Bug        |         Status:  new
              Component:  Core       |        Version:  1.10
  (Other)                            |       Keywords:
               Severity:  Normal     |  DATA_UPLOAD_MAX_MEMORY_SIZE,
                                     |  RequestDataTooBig,
           Triage Stage:             |  response_for_exception, 500
  Unreviewed                         |      Has patch:  0
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 When a RequestDataTooBig is raised response_for_exception tries to access
 request data again triggering a new RequestDataTooBig.
 This results in an error 500.


 {{{
 Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
 Traceback (most recent call last):
   File "../python2.7/wsgiref/handlers.py", line 85, in run
     self.result = application(self.environ, self.start_response)
   File "../python2.7/site-
 packages/django/contrib/staticfiles/handlers.py", line 63, in __call__
     return self.application(environ, start_response)
   File "../python2.7/site-packages/dj_static.py", line 83, in __call__
     return self.application(environ, start_response)
   File "../python2.7/site-packages/dj_static.py", line 83, in __call__
     return self.application(environ, start_response)
   File "../python2.7/site-packages/django/core/handlers/wsgi.py", line
 175, in __call__
     response = self.get_response(request)
   File "../python2.7/site-packages/django/core/handlers/base.py", line
 124, in get_response
     response = self._middleware_chain(request)
   File "../python2.7/site-packages/django/core/handlers/exception.py",
 line 41, in inner
     response = response_for_exception(request, exc)
   File "../python2.7/site-packages/django/core/handlers/exception.py",
 line 77, in response_for_exception
     response = debug.technical_500_response(request, *sys.exc_info(),
 status_code=400)
   File "../python2.7/site-packages/django/views/debug.py", line 81, in
 technical_500_response
     text = reporter.get_traceback_text()
   File "../python2.7/site-packages/django/views/debug.py", line 323, in
 get_traceback_text
     return t.render(c)
   File "../python2.7/site-packages/django/template/base.py", line 208, in
 render
     return self._render(context)
   File "../python2.7/site-packages/django/template/base.py", line 199, in
 _render
     return self.nodelist.render(context)
   File "../python2.7/site-packages/django/template/base.py", line 994, in
 render
     bit = node.render_annotated(context)
   File "../python2.7/site-packages/django/template/base.py", line 961, in
 render_annotated
     return self.render(context)
   File "../python2.7/site-packages/django/template/defaulttags.py", line
 315, in render
     return nodelist.render(context)
   File "../python2.7/site-packages/django/template/base.py", line 994, in
 render
     bit = node.render_annotated(context)
   File "../python2.7/site-packages/django/template/base.py", line 961, in
 render_annotated
     return self.render(context)
   File "../python2.7/site-packages/django/template/defaulttags.py", line
 159, in render
     values = self.sequence.resolve(context, True)
   File "../python2.7/site-packages/django/template/base.py", line 711, in
 resolve
     obj = self.var.resolve(context)
   File "../python2.7/site-packages/django/template/base.py", line 852, in
 resolve
     value = self._resolve_lookup(context)
   File "../python2.7/site-packages/django/template/base.py", line 893, in
 _resolve_lookup
     current = getattr(current, bit)
   File "../python2.7/site-packages/django/core/handlers/wsgi.py", line
 146, in _get_files
     self._load_post_and_files()
   File "../python2.7/site-packages/django/http/request.py", line 311, in
 _load_post_and_files
     self._post, self._files = QueryDict(self.body,
 encoding=self._encoding), MultiValueDict()
   File "../python2.7/site-packages/django/http/request.py", line 269, in
 body
     raise RequestDataTooBig('Request body exceeded
 settings.DATA_UPLOAD_MAX_MEMORY_SIZE.')
 RequestDataTooBig: Request body exceeded
 settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27820>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/055.dcc3e804e6f8804a3ce245fef2b87c6c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to