Edgewall Software
Modify

Opened 11 years ago

Closed 11 years ago

#11037 closed defect (cantfix)

MySQL server gone away intermittent bug

Reported by: peter@… Owned by:
Priority: normal Milestone:
Component: database backend Version: 1.0
Severity: normal Keywords: mysql needinfo
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

After a few hours our trac starts returning this traceback in the browser:

Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/api.py", line 502, in send_error
    data, 'text/html')
  File "build/bdist.linux-i686/egg/trac/web/chrome.py", line 955, in render_template
    message = req.session.pop('chrome.%s.%d' % (type_, i))
  File "build/bdist.linux-i686/egg/trac/web/api.py", line 304, in __getattr__
    value = self.callbacks[name](self)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 268, in _get_session
    return Session(self.env, req)
  File "build/bdist.linux-i686/egg/trac/web/session.py", line 211, in __init__
    self.get_session(req.authname, authenticated=True)
  File "build/bdist.linux-i686/egg/trac/web/session.py", line 229, in get_session
    super(Session, self).get_session(sid, authenticated)
  File "build/bdist.linux-i686/egg/trac/web/session.py", line 84, in get_session
    """, (sid, int(authenticated))):
  File "build/bdist.linux-i686/egg/trac/db/util.py", line 121, in execute
    cursor.execute(query, params)
  File "build/bdist.linux-i686/egg/trac/db/util.py", line 65, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "build/bdist.linux-i686/egg/MySQLdb/cursors.py", line 201, in execute
    self.errorhandler(self, exc, value)
  File "build/bdist.linux-i686/egg/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (2006, 'MySQL server has gone away')

for an increasing proportion of requests, up to 90%. Restarting httpd seems to clear it.

Yes, I have read through 3645 . Note that we are on Trac 1.0. We upgraded MySQL and rebuilt the MySqlDb bindings for thread safety. See system information:

Trac 	1.0
Genshi 	0.6 (without speedups)
mod_wsgi 	3.4 (WSGIProcessGroup WSGIApplicationGroup %{GLOBAL})
MySQL 	server: "5.5.29", client: "5.5.29", thread-safe: 1
MySQLdb 	1.2.4
Python 	2.6.8 (unknown, Nov 7 2012, 14:47:34) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)]
setuptools 	0.6c11
jQuery	1.7.2

When this problem occurs nothing shows up in the mysqld log or the trac log. The query:

SELECT version,time,author,comment,ipnr FROM
    ->  wiki WHERE name='WikiStart' AND version<=28 ORDER BY version DESC;

directly against mysql succeeds and returns results.

Nothing shows up in the apache error log and the access log shows just a 500 status.

Other info:

bash-3.2# uname -a
Linux webvm-trac 2.6.18-348.el5.centos.plus #1 SMP Thu Jan 10 20:23:09 EST 2013 i686 i686 i386 GNU/Linux

Attachments (0)

Change History (3)

comment:1 by Christian Boos, 11 years ago

I'd suggest that you enable the [trac] debug_sql option, and see if there are some queries taking exceedingly long time. Large queries can also be problematic, it seems. In general, there seem to be too many possible reasons for this problem for us to be able to guess what the cause is…

Try also to increase the log level on the mysqld side, there must be something happening there as well. At the very least, monitoring the lifetime of the connections on the MySQL side could give further hints (don't know how to do that though).

comment:2 by Christian Boos, 11 years ago

Keywords: mysql needinfo added
Version: 1.0

comment:3 by Christian Boos, 11 years ago

Resolution: cantfix
Status: newclosed

No feedback, closing.

Modify Ticket

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