Edgewall Software
Modify

Opened 18 years ago

Closed 16 years ago

#3819 closed defect (fixed)

IOError: SSL, mod_python and Internet Explorer

Reported by: simon-code@… Owned by: Christopher Lenz
Priority: normal Milestone: 0.11
Component: web frontend/mod_python Version: 0.10rc1
Severity: normal Keywords: verify
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

After upgrading from 0.9.6 to 0.10, my Apache error.log fills up with a new error message:

[Fri Sep 29 09:44:36 2006] [error] [client 192.168.168.210] PythonHandler trac.web.modpython_frontend: Traceback (most recent call last):, referer: https://test.coderesort.no/about/wiki/Tour
[Fri Sep 29 09:44:36 2006] [error] [client 192.168.168.210] PythonHandler trac.web.modpython_frontend:   File "C:\\Python23\\lib\\site-packages\\mod_python\\apache.py", line 299, in HandlerDispatch\n    result = object(req), referer: https://test.coderesort.no/about/wiki/Tour
[Fri Sep 29 09:44:36 2006] [error] [client 192.168.168.210] PythonHandler trac.web.modpython_frontend:   File "C:\\Python23\\Lib\\site-packages\\trac\\web\\modpython_frontend.py", line 87, in handler\n    gateway.run(dispatch_request), referer: https://test.coderesort.no/about/wiki/Tour
[Fri Sep 29 09:44:36 2006] [error] [client 192.168.168.210] PythonHandler trac.web.modpython_frontend:   File "C:\\Python23\\Lib\\site-packages\\trac\\web\\wsgi.py", line 91, in run\n    self._sendfile(response.fileobj), referer: https://test.coderesort.no/about/wiki/Tour
[Fri Sep 29 09:44:36 2006] [error] [client 192.168.168.210] PythonHandler trac.web.modpython_frontend:   File "C:\\Python23\\Lib\\site-packages\\trac\\web\\modpython_frontend.py", line 73, in _sendfile\n    self.req.sendfile(fileobj.name), referer: https://test.coderesort.no/about/wiki/Tour
[Fri Sep 29 09:44:36 2006] [error] [client 192.168.168.210] PythonHandler trac.web.modpython_frontend: IOError: Write failed, client closed connection., referer: https://test.coderesort.no/about/wiki/Tour

The error is only produced when using Internet Explorer (not Firefox or Safari), and only when using https access. The error is produced when accessing various modules, and a quick scan of the error log show the error when using wiki, report, timeline and browser - ie. most likely a generic web handler problem, and not module specific.

The error does not manifest itself at the user - from the user perspective, all pages loads as expected without visible errors or problems.

Attachments (0)

Change History (7)

comment:1 by Christian Boos, 17 years ago

Keywords: needinfo added

Sorry, that ticket went unnoticed…

Since this is an old ticket, this is likely not an issue anymore, but just in case you'd like to give some follow-up informations:

  • what mod_python version were you using?
  • how did you solve the problem?

In case the problem is still there, try upgrading to mod_python 3.3.1.

comment:2 by simon-code@…, 17 years ago

Actually, the problem is very much alive & kicking… I am currently using mod_python 3.3.1, Apache 2.0.59 on Windows. Back when the ticket was new, someone also contacted me directly with the same problem.

As my log now has slightly more elaborate information, I include an up-to-date example of the error message - this for a request for my .ico file packaged as part of a custom plugin ('codebvn'):

[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150] mod_python (pid=3832, interpreter='www.coderesort.com', phase='PythonHandler', handler='trac.web.modpython_frontend'): Application error
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150] ServerName: 'www.coderesort.com'
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150] DocumentRoot: 'C:/code/htdocs'
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150] URI: '/projects/epicode/chrome/codebvn/code.ico'
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150] Location: '/projects'
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150] Directory: None
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150] Filename: 'C:/code/htdocs/projects'
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150] PathInfo: '/epicode/chrome/codebvn/code.ico'
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150] Traceback (most recent call last):
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150]   File "C:\\Python23\\lib\\site-packages\\mod_python\\importer.py", line 1537, in HandlerDispatch\n    default=default_handler, arg=req, silent=hlist.silent)
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150]   File "C:\\Python23\\lib\\site-packages\\mod_python\\importer.py", line 1229, in _process_target\n    result = _execute_target(config, req, object, arg)
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150]   File "C:\\Python23\\lib\\site-packages\\mod_python\\importer.py", line 1128, in _execute_target\n    result = object(arg)
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150]   File "C:\\Python23\\lib\\site-packages\\trac\\web\\modpython_frontend.py", line 87, in handler\n    gateway.run(dispatch_request)
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150]   File "C:\\Python23\\lib\\site-packages\\trac\\web\\wsgi.py", line 91, in run\n    self._sendfile(response.fileobj)
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150]   File "C:\\Python23\\lib\\site-packages\\trac\\web\\modpython_frontend.py", line 73, in _sendfile\n    self.req.sendfile(fileobj.name)
[Tue Apr 10 17:31:10 2007] [error] [client 83.55.26.150] IOError: Write failed, client closed connection.

The problem originally appeared by Trac upgrade only - no new externals or config settings. That is why I thought it related to the new WSGI support and frontend handling. My Apache config is quite standard based on recommended Trac and SVN setup, with some additional SSL and redirect/rewrite rules. Maybe something with the way incoming requests throguh SSL and rewrite/redirect is handled in the Trac wsgi & mod_python frontend?

comment:3 by adam.laczo@…, 17 years ago

I'm having the same problems. I installed Trac on my FC7 machine, and it seems to work fine when I try the test web server, but when I try to get it to work with Apache, I get a similiar problem as listed above. Has anyone found a solution to this?

comment:4 by Christian Boos, 17 years ago

Keywords: verify added; needinfo removed
Milestone: 0.10.5

Could that be a duplicate of #2553?

IOW, does r5642 (trunk) or r5644 (0.10-stable) fix the issue?

comment:5 by jeroen, 16 years ago

I also have this issue with Trac-0.11-r6137 using WSGI as a frontend, so it is not magically solved until that version. The following shows up in the ssl_error_log:

[Thu Dec 27 17:23:45 2007] [error] [client xx.xx.xx.xx] IOError: failed to write data, referer: https://xxxxxxxx/support/wiki
[Thu Dec 27 17:23:45 2007] [error] [client xx.xx.xx.xx] mod_wsgi (pid=32741): Exception occurred within WSGI script '/xxxxxxxx/trac.wsgi'., referer: https://xxxxxxxx/support/wiki

comment:6 by osimons, 16 years ago

Seems all the errors I get are related to modpython_frontend _sendfile() which I suppose in theory should handle client disconnects in the same manner as _write(). Using the same try: except: wrapping as for _write() seems to solve the issue:

  • trac/web/modpython_frontend.py

     
    107107
    108108    def _sendfile(self, fileobj):
    109109        self._send_headers()
    110         self.req.sendfile(fileobj.name)
     110        try:
     111            self.req.sendfile(fileobj.name)
     112        except IOError, e:
     113            if 'client closed connection' not in str(e):
     114                raise
    111115
    112116    def _write(self, data):
    113117        self._send_headers()

It would be nice if someone could verify the approach before I commit.

comment:7 by osimons, 16 years ago

Milestone: 0.10.50.11
Resolution: fixed
Status: newclosed

It works well, and committed in [6751].

PS! As for the mod_wsgi issue in comment:5, that is something else not related to this mod_python frontend issue. Likely it is also raised after Trac has finished reponse handling, so you could check with the modwsgi project to see if you can locate any relevant information there.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz 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.