Edgewall Software

Opened 10 years ago

Closed 10 years ago

#11551 closed defect (fixed)

upgrade to os x 10.9 seems to introduce tracd errors — at Version 6

Reported by: Bill Hernandez (Plano, Texas) Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: general Version: 1.0.1
Severity: normal Keywords: http11 exception tracd
Cc: Branch:
Release Notes:

Avoid "Broken pipe" from tracd if the client disconnects on Python 2.6 and later.

API Changes:
Internal Changes:

Description (last modified by Jun Omae)

I have installed OS X 10.9 Mavericks on several machines, and after reboot I notice errors that I have not seen with prior versions of the operating system.

$ tracd --version
tracd 1.0.1

Any ideas ?

Bill Hernandez Plano, Texas

$ export TRAC_ENV_INDEX_TEMPLATE=/source/templates/projects.html
$ trac_env=/source/trac; /usr/local/bin/tracd --port=8000 -e ${trac_env} --basic-auth=*,${trac_env}/.htpasswd,${trac_env}
Server starting in PID 472.
Serving on 0.0.0.0:8000 view at http://127.0.0.1:8000/
Using HTTP/1.1 protocol version
127.0.0.1 - - [18/Mar/2014 22:02:31] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [18/Mar/2014 22:02:31] "GET / HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 49279)
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 "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 651, in __init__
    self.finish()
 File "build/bdist.macosx-10.8-intel/egg/trac/web/wsgi.py", line 196, in finish
    BaseHTTPRequestHandler.finish(self)
 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
----------------------------------------
NOTICE THE LINE CONTAINING: File "build/bdist.macosx-10.8-intel/egg/trac/web/wsgi.py", line 196, in finish

I was not able to find any info on how to remove "build/bdist.macosx-10.8-intel" and install "build/bdist.macosx-10.9-intel"

I am not a python person, so I would be most grateful for some detailed info…

Change History (6)

comment:1 by Bill Hernandez (Plano, Texas), 10 years ago

Description: modified (diff)

comment:2 by Jun Omae, 10 years ago

Description: modified (diff)
Priority: highestnormal

comment:3 by Bill Hernandez Plano, Texas, 10 years ago

I have an applescript that sets up a number of things, launches the terminal, launches Safari and pulls up my master page.

I changed all the references to Safari with "Google Chrome", restarted the machine and there was no change in the errors.

Hopefully someone will have a fix.

Thank You!

comment:4 by Jun Omae, 10 years ago

Keywords: http11 exception tracd added
Milestone: 0.12.6
Owner: set to Jun Omae
Status: newassigned

Reproduced on Python 2.6 and 2.7 on Linux with Firefox and Chrome on Windows. Not reproduced on Python 2.5. When the client disconnects, the issue occurs. #8357 is related.

Try the following patch.

  • trac/web/wsgi.py

    diff --git a/trac/web/wsgi.py b/trac/web/wsgi.py
    index 820144f..ed9216e 100644
    a b class WSGIRequestHandler(BaseHTTPRequestHandler):  
    194194
    195195    def finish(self):
    196196        """We need to help the garbage collector a little."""
    197         BaseHTTPRequestHandler.finish(self)
    198         self.wfile = None
    199         self.rfile = None
     197        try:
     198            BaseHTTPRequestHandler.finish(self)
     199        except (IOError, socket.error), e:
     200            if e.args[0] not in (errno.EPIPE, errno.ECONNRESET, 10053, 10054):
     201                # ignore an exception when the client disconnects
     202                raise
     203        finally:
     204            self.wfile = None
     205            self.rfile = None
    200206
    201207
    202208class WSGIServerGateway(WSGIGateway):

comment:5 by Bill Hernandez (Plano, Texas), 10 years ago

AWESOME, The patch fixed the problem !

I can't believe how fast you guys came up with a solution to my problem !

The very best to all who responded…

comment:6 by Jun Omae, 10 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Thanks for rapid feedback ;)

Committed in [12600] and merged to 1.0-stable in [12601] and trunk in [12602].

Note: See TracTickets for help on using tickets.