Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I get this exception, too. In the Apache error logfile I see this:</p> <pre><code>[Wed Aug 17 08:30:45 2011] [error] [client 10.114.48.206] (70014)End of file found: mod_wsgi (pid=9722): Unable to get bucket brigade for request., referer: https://egs-work/modwork/beleg/188074/edit/ [Wed Aug 17 08:30:45 2011] [error] [client 10.114.48.206] mod_wsgi (pid=3572): Exception occurred processing WSGI script '/home/modwork_egs_p/modwork_egs/apache/django_wsgi.py'. [Wed Aug 17 08:30:45 2011] [error] [client 10.114.48.206] IOError: failed to write data </code></pre> <p>Versions:</p> <pre><code>apache2-prefork-2.2.15-3.7.x86_64 apache2-mod_wsgi-3.3-1.8.x86_64 WSGIDaemonProcess with threads=1 mod_ssl/2.2.15 Linux egs-work 2.6.34.8-0.2-default #1 SMP 2011-04-06 18:11:26 +0200 x86_64 x86_64 x86_64 GNU/Linux openSUSE 11.3 (x86_64) </code></pre> <p>First I was confused, because the last line "failed to <strong>write</strong> data" does not fit to the django code "load post data". But I guess that django wants to write an error page to the client. But the client has canceled the tcp connection. And now http 500 page can't be written to the client.</p> <p>The client disconnected after sending the request, and before getting the response:</p> <ul> <li>The user closed the browser or navigated to an other page.</li> <li>The user pressed the reload button.</li> </ul> <p>I have seen this only with POST-Requests (not GET). If POST is used, the webserver does read at least twice: First to get the headers, the second to get the data. The second read fails.</p> <p>It is easy to reproduce:</p> <p>Insert some code which waits before the first access to request.POST happens (be sure, that no middleware accesses request.POST before time.sleep()):</p> <pre><code>def edit(request): import time time.sleep(3) #..... </code></pre> <p>Now do a big POST (e.g. file upload). I don't know the apache buffer size. But 5 MB should be enough. When the browser shows the hourglass, browse to an other page. The browser will cancel the request and the exception should be in the logfile.</p> <p>This is my Middleware, since I don't want to get the above traceback in our logfiles:</p> <pre><code>class HandleExceptionMiddleware: def process_exception(self, request, exception): if isinstance(exception, IOError) and 'request data read error' in unicode(exception): logging.info('%s %s: %s: Request was canceled by the client.' % ( request.build_absolute_uri(), request.user, exception)) return HttpResponseServerError() </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload