14

I am getting this weird error in my development server when running my django project:

Traceback (most recent call last):
  File "/home/sam/django-projects/datazone/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 284, in run
    self.finish_response()
  File "/home/sam/django-projects/datazone/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 324, in finish_response
    self.write(data)
  File "/home/sam/django-projects/datazone/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 403, in write
    self.send_headers()
  File "/home/sam/django-projects/datazone/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 467, in send_headers
    self.send_preamble()
  File "/home/sam/django-projects/datazone/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 385, in send_preamble
    'Date: %s\r\n' % http_date()
  File "/usr/lib/python2.7/socket.py", line 324, in write
    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

Can someone shed some light on this for me?

Darwin Tech
  • 18,449
  • 38
  • 112
  • 187

1 Answers1

14

This happens when the client closes the connection before the server finished sending the data. If it only happens sometimes and is not a persistent problem ignore it.

  • 1
    Ok, but I am noticing extreme slow down with my requests in Django as well. – Darwin Tech Apr 20 '12 at 20:59
  • 3
    The development server is just ment for development. If you are using Chrome(ium) make sure you do use Django 1.4 and/or disable parallel requests and prefetching (Chrome has an insane default config for development servers) – Florian Apolloner Apr 20 '12 at 21:01
  • So, it is definitely a Chrome issue. Firefox works fine. This just started happening in the last 24hours though which is very strange. I can't upgrade to 1.4 at the moment as the production server is running 1.3 for the time being. – Darwin Tech Apr 20 '12 at 21:16
  • Well if you had a chrome update recently that might explain it. Btw please consider accepting the answer as correct and probably open another question for the chrome issue? (not sure how stackoverflow expects us to handle follow up questions, I am kinda new here ;)) – Florian Apolloner Apr 20 '12 at 21:19
  • I've been getting this error constantly lately. Could it be due to some recent update in Chrome? – LS55321 Jan 02 '14 at 14:21
  • Its hard to ignore just because its development server, in fact more reason to fix it as most of the time developer spend on development server. In any case, this issue has long running threads on various forums. Hope to see it get fixed in near future. – Mutant Sep 02 '15 at 19:44
  • This is fixed since quite a few Django versions (ie since Django runserver uses threads). The error can obviously still occur, but not frequent, and no there is nothing in Django which we can fix there. – Florian Apolloner Sep 02 '15 at 23:00