#9973 closed defect (fixed)
Internal Server Errors
Reported by: | Owned by: | Jun Omae | |
---|---|---|---|
Priority: | normal | Milestone: | 0.12.6 |
Component: | web frontend | Version: | 0.12.1 |
Severity: | normal | Keywords: | mod_wsgi |
Cc: | Branch: | ||
Release Notes: |
Avoid noisy logs in apache error log with mod_wsgi if the client disconnects |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
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)
follow-up: 2 comment:1 by , 14 years ago
Description: | modified (diff) |
---|
comment:2 by , 14 years ago
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 by , 13 years ago
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
follow-up: 6 comment:4 by , 11 years ago
it's no problem says TH:#11149
the question is if Trac can suppress the exception message
comment:6 by , 11 years ago
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): 626 626 except (IOError, socket.error), e: 627 627 if e.args[0] in (errno.EPIPE, errno.ECONNRESET, 10053, 10054): 628 628 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 629 635 raise 630 636 631 637 # Internal methods
comment:8 by , 11 years ago
Milestone: | next-minor-0.12.x → 0.12.6 |
---|---|
Owner: | set to |
Status: | new → assigned |
Ok, I'll push the patch to 0.12-stable. There are the same noisy logs in my production environments using mod_wsgi.
comment:10 by , 11 years ago
Keywords: | mod_wsgi added |
---|---|
Release Notes: | modified (diff) |
Resolution: | → fixed |
Status: | assigned → closed |
Fixed in [11841].
comment:12 by , 11 years ago
[11841] has been already merged in [11842-11843] (1.0-stable and trunk).
comment:13 by , 10 years ago
Component: | general → web frontend |
---|
Which web server and frontend (fcgi, mod_python, …) are you using?