Django broken pipe error

justin walters walters.justin01 at gmail.com
Tue Dec 6 13:28:36 EST 2016


On Tue, Dec 6, 2016 at 6:21 AM, <dr.roman.graf at gmail.com> wrote:

> Hi,
>
> I'm facing strange Django broken pipe error (Python 2.7 on Ubuntu) that
> apparently is a not fixed Django bug. Does anybody now how to fix it? I've
> been searching a lot and didn't find any solution.
>
> This error happens very irregularly by Post request in Django. Sometimes
> it works sometimes not:
>
> [06/Dec/2016 13:33:57] "POST /export_report/ HTTP/1.1" 500 59
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/SocketServer.py", line 593, in
> process_request_thread
>     self.finish_request(request, client_address)
>   File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
>     self.RequestHandlerClass(request, client_address, self)
>   File "/home/ait/.virtualenvs/env1/local/lib/python2.7/site-
> packages/django/core/servers/basehttp.py", line 129, in __init__
>     super(WSGIRequestHandler, self).__init__(*args, **kwargs)
>   File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
>     self.finish()
>   File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
>     self.wfile.close()
>   File "/usr/lib/python2.7/socket.py", line 279, in close
>     self.flush()
>   File "/usr/lib/python2.7/socket.py", line 303, in flush
>     self._sock.sendall(view[write_offset:write_offset+buffer_size])
> error: [Errno 32] Broken pipe
> ----------------------------------------
> Exception happened during processing of request from ('127.0.0.1', 38224)
>
> It is also described in: https://www.reddit.com/r/
> joinmarket/comments/4atqrm/is_this_exception_normal_exception_happened/
>
> On https://bugs.python.org/issue14574 is stated that this error should
> already be fixed but apparently not.
>
> Best regards,
>
> Roman


Hi Roman,

Is this happening on the dev server or a production server? Did you use the
command ./manage.py runserver to start the server?

Can you please provide the code for the view class/function that is
throwing the error? I believe that this issue
may be caused by a call to the database not being structured correctly.



More information about the Python-list mailing list