mozilla / django-browserid

Django application for adding BrowserID support.
Mozilla Public License 2.0
180 stars 80 forks source link

[Errno 32] Broken pipe on POST to /browserid/login/ and /browserid/csrf/ #276

Closed aaadotpm closed 9 years ago

aaadotpm commented 9 years ago

Login through browserid on a local dev setup (django 1.5.9 and 1.7.4) fails. It redirects to /undefined and is not logged in. Looking at the log I get error: [Errno 32] Broken pipe. This happens on requests to either /browserid/login/ or /browserid/csrf/

Happy to provide more information if needed.

Traceback

Exception happened during processing of request from ('127.0.0.1', 64454)
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 593, in process_request_thread
    self.finish_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/Users/seb/.virtualenvs/projectname/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 143, in __init__
    super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 651, in __init__
    self.finish()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 710, in finish
    self.wfile.close()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 279, in close
    self.flush()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------

I did not get these errors in version 0.6

Osmose commented 9 years ago

Thanks for the report!

Hmmm, weird. Broken pipe sounds like some sort've local networking issue. There's https://code.djangoproject.com/ticket/4444 which says that Broken Pipe errors while running locally are a bit random and sort've expected; are you getting this consistently?

If so, do you have a branch or anything I can check out locally to see if I can replicate?

aaadotpm commented 9 years ago

Well, this is a bit embarrassing. I just went through some other template code before making a small project to send you, and realise that it was loading jQuery 1.7.2. I thought it was loading 1.9.1 but it was jQuery UI.

Updated to newest jQuery 1.10.1 and it works a treat now. Maybe it could help someone else with a similar problem in the future.

Osmose commented 9 years ago

Cool, glad you were able to solve it! I'll keep this in mind in case anyone runs into a similar issue. Thanks!