Edgewall Software

Opened 8 years ago

Closed 8 years ago

#11551 closed defect (fixed)

upgrade to os x 10.9 seems to introduce tracd errors

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 view at
Using HTTP/1.1 protocol version - - [18/Mar/2014 22:02:31] "GET / HTTP/1.1" 200 - - - [18/Mar/2014 22:02:31] "GET / HTTP/1.1" 200 -
Exception happened during processing of request from ('', 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__
 File "build/bdist.macosx-10.8-intel/egg/trac/web/wsgi.py", line 196, in finish
 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 710, in finish
 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 279, in close
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 303, in flush
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…

Attachments (0)

Change History (6)

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

Description: modified (diff)

comment:2 by Jun Omae, 8 years ago

Description: modified (diff)
Priority: highestnormal

comment:3 by Bill Hernandez Plano, Texas, 8 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, 8 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):  
    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
    202208class WSGIServerGateway(WSGIGateway):

comment:5 by Bill Hernandez (Plano, Texas), 8 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, 8 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].

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.