Edgewall Software
Modify

Opened 7 years ago

Closed 5 years ago

Last modified 3 years ago

#9973 closed defect (fixed)

Internal Server Errors

Reported by: sbranden@… Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: web frontend Version: 0.12.1
Severity: normal Keywords: mod_wsgi
Cc:
Release Notes:

Avoid noisy logs in apache error log with mod_wsgi if the client disconnects

API Changes:

Description (last modified by Remy Blank)

Upgrade from Trac 0.10 to 0.12.1 now results in the following server errors in the trac.log

2011-01-12 19:48:53,628 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "/opt/lampp/lib/python2.5/site-packages/Trac-0.12.1-py2.5.egg/trac/web/main.py", line 511, in _dispatch_request
    dispatcher.dispatch(req)
  File "/opt/lampp/lib/python2.5/site-packages/Trac-0.12.1-py2.5.egg/trac/web/main.py", line 261, in dispatch
    req.send(output, content_type or 'text/html')
  File "/opt/lampp/lib/python2.5/site-packages/Trac-0.12.1-py2.5.egg/trac/web/api.py", line 412, in send
    self.write(content)
  File "/opt/lampp/lib/python2.5/site-packages/Trac-0.12.1-py2.5.egg/trac/web/api.py", line 532, in write
    self._write(data)
IOError: client connection closed
Trac Server Info:
System Information
Trac 	0.12.1
Genshi 	0.6
Pygments 	0.9
pysqlite 	2.3.2
Python 	2.5.1 (r251:54863, Oct 30 2007, 17:07:30) [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)]
setuptools 	0.6c7
SQLite 	3.3.17
Subversion 	1.4.6 (r28521)
jQuery:	1.4.2

Attachments (0)

Change History (13)

comment:1 Changed 7 years ago by Remy Blank

Description: modified (diff)

Which web server and frontend (fcgi, mod_python, …) are you using?

comment:2 in reply to:  1 Changed 7 years ago by anonymous

Replying to rblank:

Which web server and frontend (fcgi, mod_python, …) are you using?

We are using mod_python with wsgi.

Apache/2.2.6 (Unix) DAV/2 
mod_ssl/2.2.6 
OpenSSL/0.9.8e 
mod_python/3.3.1 
Python/2.5.1 
mod_fastcgi/2.4.6 
SVN/1.6.9 
mod_apreq2-20051231/2.5.7 
mod_wsgi/1.3

comment:3 Changed 6 years ago by anonymous

We have the same problem from time to time with trac 0.12.2:

mod_wsgi (pid=2172): Exception occurred processing WSGI script 'C:/Program Files/Apache/cgi-bin/trac_ec.wsgi'.
Traceback (most recent call last):
   File "C:/Program Files/Apache/cgi-bin/trac_ec.wsgi", line 7, in application
     return dispatch_request(environ, start_request)
   File "C:\\Python27\\lib\\site-packages\\trac\\web\\main.py", line 479, in dispatch_request
     return _dispatch_request(req, env, env_error)
   File "C:\\Python27\\lib\\site-packages\\trac\\web\\main.py", line 555, in _dispatch_request
     send_internal_error(env, req, sys.exc_info())
   File "C:\\Python27\\lib\\site-packages\\trac\\web\\main.py", line 648, in send_internal_error
     req.send_error(exc_info, status=500, env=env, data=data)
   File "C:\\Python27\\lib\\site-packages\\trac\\web\\api.py", line 462, in send_error
     exc_info)
   File "C:\\Python27\\lib\\site-packages\\trac\\web\\main.py", line 511, in _dispatch_request
     dispatcher.dispatch(req)
   File "C:\\Python27\\lib\\site-packages\\trac\\web\\main.py", line 261, in dispatch
     req.send(output, content_type or 'text/html')
   File "C:\\Python27\\lib\\site-packages\\trac\\web\\api.py", line 416, in send
     self.write(content)
   File "C:\\Python27\\lib\\site-packages\\trac\\web\\api.py", line 536, in write
     self._write(data)
 IOError: failed to write data
Apache/2.2.9 (Win32) 
DAV/2 mod_ssl/2.2.9 
OpenSSL/1.0.0g 
SVN/1.7.3 
mod_wsgi/3.3 
Python/2.7.2 
mod_auth_sspi/1.0.4 
PHP/5.2.6

comment:4 Changed 5 years ago by anonymous

it's no problem says TH:#11149

the question is if Trac can suppress the exception message

comment:5 Changed 5 years ago by anonymous

would be helpful 'cause it spams my log file

comment:6 in reply to:  4 Changed 5 years ago by Jun Omae

Replying to anonymous:

the question is if Trac can suppress the exception message

It needs to apply the following patch.

  • trac/web/api.py

    diff --git a/trac/web/api.py b/trac/web/api.py
    index 3af271b..2bf0253 100644
    a b class Request(object):  
    626626        except (IOError, socket.error), e:
    627627            if e.args[0] in (errno.EPIPE, errno.ECONNRESET, 10053, 10054):
    628628                raise RequestDone
     629            # Note that mod_wsgi raises an IOError with only a message
     630            # if a client disconnects
     631            if 'mod_wsgi.version' in self.environ and \
     632               e.args[0] in ('failed to write data',
     633                             'client connection closed'):
     634                raise RequestDone
    629635            raise
    630636
    631637    # Internal methods

comment:7 Changed 5 years ago by anonymous

plz, apply the patch. I got tons of such annoying msgs too

comment:8 Changed 5 years ago by Jun Omae

Milestone: next-minor-0.12.x0.12.6
Owner: set to Jun Omae
Status: newassigned

Ok, I'll push the patch to 0.12-stable. There are the same noisy logs in my production environments using mod_wsgi.

comment:9 Changed 5 years ago by anonymous

thnx jomae

comment:10 Changed 5 years ago by Jun Omae

Keywords: mod_wsgi added
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed in [11841].

comment:11 Changed 5 years ago by anonymous

when are you going to merge [11841] back to 1.0.2 branch?

comment:12 Changed 5 years ago by Jun Omae

[11841] has been already merged in [11842-11843] (1.0-stable and trunk).

comment:13 Changed 3 years ago by Ryan J Ollos

Component: generalweb frontend

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted.
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.