Edgewall Software

Ticket #6237 (new defect)

Opened 13 months ago

Last modified 7 weeks ago

InterfaceError: (0, '') after idle period with mod_wsgi 1.1/Apache 2.2.3

Reported by: kig Owned by: jonas
Priority: normal Milestone:
Component: general Version: devel
Severity: normal Keywords: mysql needinfo
Cc:

Description

How to Reproduce

We are getting InterfaceError?: (0, ) on various pages occasionally, mostly after Trac's been idle for some time. Usually happens in the morning, and after refresh or two the error goes away.

We are running latest Trac with mod_wsgi on Apache. Here is apache info:

Server version: Apache/2.2.3 Server built: Aug 16 2006 00:15:34 Server's Module Magic Number: 20051115:3 Server loaded: APR 1.2.7, APR-Util 1.2.7 Compiled using: APR 1.2.7, APR-Util 1.2.7 Architecture: 32-bit Server MPM: Prefork

threaded: no

forked: yes (variable process count)

Server compiled with....

-D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=128 -D HTTPD_ROOT="/etc/httpd" -D SUEXEC_BIN="/usr/sbin/suexec" -D DEFAULT_PIDLOG="logs/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_LOCKFILE="logs/accept.lock" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf"

mod_wsgi 1.1

GET operation on /wiki, Trac issued an internal error.

(please provide additional details here)

System Information

Trac 0.11dev-r6060
Python 2.3.4 (#1, May 2 2007, 19:26:00)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-8)]
setuptools 0.6c7
MySQL server: "5.0.22", client: "4.1.22", thread-safe: 1
MySQLdb 1.2.1_p2
Genshi 0.4.4
Subversion 1.2.1 (r15230)

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r6060-py2.3.egg/trac/web/main.py", line 381, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r6060-py2.3.egg/trac/web/main.py", line 160, in dispatch
    if handler.match_request(req):
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r6060-py2.3.egg/trac/wiki/web_ui.py", line 97, in match_request
    if 'WIKI_VIEW' in req.perm('wiki') and match:
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r6060-py2.3.egg/trac/perm.py", line 444, in has_permission
    decision = PermissionSystem(self.env). \
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r6060-py2.3.egg/trac/perm.py", line 362, in check_permission
    decision = policy.check_permission(username, action, context)
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r6060-py2.3.egg/trac/perm.py", line 221, in check_permission
    return PermissionSystem(self.env). \
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r6060-py2.3.egg/trac/perm.py", line 293, in get_user_permissions
    for perm in self.store.get_user_permissions(username):
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r6060-py2.3.egg/trac/perm.py", line 135, in get_user_permissions
    cursor.execute("SELECT username,action FROM permission")
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r6060-py2.3.egg/trac/db/util.py", line 51, in execute
    return self.cursor.execute(sql)
  File "/usr/lib/python2.3/site-packages/Trac-0.11dev_r6060-py2.3.egg/trac/db/util.py", line 51, in execute
    return self.cursor.execute(sql)
  File "/usr/lib/python2.3/site-packages/MySQLdb/cursors.py", line 145, in execute
    charset = db.character_set_name()
InterfaceError: (0, '')

Attachments

Change History

Changed 13 months ago by cboos

  • keywords mysql needinfo added; mod_wsgi apache removed
  • milestone changed from 0.11.1 to 0.10.5

Related to the reconnect issue discussed in #5783?

Can you please test the patch in that ticket?

Changed 12 months ago by cboos

  • milestone 0.10.5 deleted

Also, you should try to see if this sill happens with newer mod_wsgi releases.

Changed 7 weeks ago by WanWizard [at] gmail.com

I can confirm this problem, stil present in the current release (0.11.1).

Tracing back our changes on the server of the last few weeks, we realized that we have this error intermittendly after we've converted the database and tables from ISO-8859-1 to UTF-8.

As test, we're restored a backup from before the conversion, and the problem was gone. So it's definately encoding related. Also, I don't think this is Trac related, but a problem in the MySQL c++ library or the MySQLdb wrapper.

Our environment:

Trac: 0.11.1
Python: 2.3.4 (#1, Feb 15 2005, 19:42:48) [GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)
setuptools: 0.6c3
MySQL: server: "4.1.22-log", client: "4.1.22", thread-safe: 0
MySQLdb: 1.2.1_p2
Genshi: 0.5.1
mod_python: < 3.2
Subversion: 1.4.3 (r23084)

jQuery: 1.2.6

Add/Change #6237 (InterfaceError: (0, '') after idle period with mod_wsgi 1.1/Apache 2.2.3)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change from jonas. Next status will be 'new'
The owner will change from jonas to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.