Opened 15 years ago

Last modified 9 years ago

#4784 new defect

When a user goes away then comes back they are getting this error some times. — at Initial Version

Reported by: todd@… Owned by: Noah Kantrowitz
Priority: normal Component: TracCasPlugin
Severity: major Keywords: cas
Cc: Trac Release: 0.11

Description

When I try to go directly to my trac install and I am logged in to CAS through another application, I am getting the following error. Doesn't happen every time, but haven't detected a pattern yet. Please feel free to ping me with additional questions.

Trac detected an internal error:

IntegrityError: (1062, "Duplicate entry 'aba89c5a0c29a2f81f18e3e4b92627da-192.168.208.103-todd' for key 'PRIMARY'")

This is probably a local installation issue. Found a bug in Trac?

If you think this should work and you can reproduce the problem, you should consider reporting this to the Trac team.

Before you do that, though, please first try searching for similar issues, as it is quite likely that this problem has been reported before. For questions about installation and configuration of Trac, please try the mailing list instead of filing a ticket.

Otherwise, please ==== How to Reproduce ==== While doing a GET operation on /login, Trac issued an internal error. (please provide additional details here) Request parameters: {'ticket': u'ST-38-2ctPpUUsq5bshjo7JwUG-www.vt.loc'} User Agent was: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.7) Gecko/2009021906 Firefox/3.0.7 ==== System Information ====
Trac 0.11.3 Python 2.5.4 (r254:67916, Feb 20 2009, 14:24:45)
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)]
setuptools 0.6c9 MySQL server: "5.1.30-community-log", client: "5.0.45", thread-safe: 1 MySQLdb 1.2.3b1 Genshi 0.5.1 Subversion 1.5.5 (r34862) jQuery: 1.2.6 ==== Python Traceback ==== Traceback (most recent call last): File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py", line 435, in _dispatch_request dispatcher.dispatch(req) File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py", line 205, in dispatch resp = chosen_handler.process_request(req) File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/auth.py", line 101, in process_request self._do_login(req) File "build/bdist.linux-i686/egg/traccas/traccas.py", line 46, in _do_login super(CasLoginModule, self)._do_login(req) File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/auth.py", line 141, in _do_login req.remote_addr, int(time.time()))) File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/db/util.py", line 50, in execute return self.cursor.execute(sql_escape_percent(sql), args) File "/opt/python/python2.5/lib/python2.5/site-packages/MySQL_python-1.2.3b1-py2.5-linux-i686.egg/MySQLdb/cursors.py", line 173, in execute self.errorhandler(self, exc, value) File "/opt/python/python2.5/lib/python2.5/site-packages/MySQL_python-1.2.3b1-py2.5-linux-i686.egg/MySQLdb/connections.py", line 35, in defaulterrorhandler raise errorclass(errorvalue) IntegrityError: (1062, "Duplicate entry 'aba89c5a0c29a2f81f18e3e4b92627da-192.168.208.103-todd' for key 'PRIMARY'") a new ticket at the Trac project site, where you can describe the problem and explain how to reproduce it.

Python Traceback Most recent call last:

  • File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py", line 435, in _dispatch_request Code fragment:
    1. try:
    2. if not env and env_error:
    3. raise HTTPInternalError(env_error)
    4. try:
    5. dispatcher = RequestDispatcher(env)
    6. dispatcher.dispatch(req)
    7. except RequestDone:
    8. pass
    9. resp = req._response or []
    10. except HTTPException, e:
    Local variables: Name Value after [u' except RequestDone:', u' pass', u' resp = ... before [u' try:', u' if not env and env_error:', u' raise ... dispatcher <trac.web.main.RequestDispatcher object at 0x8d5276c> e IntegrityError(IntegrityError(1062, "Duplicate entry ... env <trac.env.Environment object at 0x89f472c> env_error None exc_info (<class '_mysql_exceptions.IntegrityError'>, ... filename '/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/tr ... frames [{'function': '_dispatch_request', 'lines_before': [u' try:', u' ... has_admin True line u' dispatcher.dispatch(req)' lineno 434 message u'IntegrityError: (1062, "Duplicate entry ... req <Request "GET u'/login'"> resp [] tb <traceback object at 0x9b04b44> tb_hide None traceback 'Traceback (most recent call last):\n File ...
  • File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py", line 205, in dispatch Code fragment:
    1. req.args.get('FORM_TOKEN') != req.form_token:
    2. raise HTTPBadRequest('Missing or invalid form token. '
    3. 'Do you have cookies enabled?')
    4. # Process the request and render the template
    5. resp = chosen_handler.process_request(req)
    6. if resp:
    7. if len(resp) == 2: # Clearsilver
    8. chrome.populate_hdf(req)
    9. template, content_type = \
    10. self._post_process_request(req, *resp)
    Local variables: Name Value chosen_handler <traccas.traccas.CasLoginModule object at 0x8d52c2c> chrome <trac.web.chrome.Chrome object at 0x8d5228c> err (<class '_mysql_exceptions.IntegrityError'>, ... handler <traccas.traccas.CasLoginModule object at 0x8d52c2c> req <Request "GET u'/login'"> self <trac.web.main.RequestDispatcher object at 0x8d5276c>
  • File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/auth.py", line 101, in process_request Code fragment:
    1. def match_request(self, req):
    2. return re.match('/(login|logout)/?$', req.path_info)
    3. def process_request(self, req):
  1. if req.path_info.startswith('/login'):
  2. self._do_login(req)
  3. elif req.path_info.startswith('/logout'):
  4. self._do_logout(req)
  5. self._redirect_back(req)
  6. # Internal methods

Local variables: Name Value req <Request "GET u'/login'"> self <traccas.traccas.CasLoginModule object at 0x8d52c2c>

  • File "build/bdist.linux-i686/egg/traccas/traccas.py", line 46, in _do_login Local variables: Name Value req <Request "GET u'/login'"> self <traccas.traccas.CasLoginModule object at 0x8d52c2c>
  • File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/auth.py", line 141, in _do_login Code fragment:
    1. cookie = hex_entropy()
    2. db = self.env.get_db_cnx()
    3. cursor = db.cursor()
    4. cursor.execute("INSERT INTO auth_cookie (cookie,name,ipnr,time) "
    5. "VALUES (%s, %s, %s, %s)", (cookie, remote_user,
    6. req.remote_addr, int(time.time())))
    7. db.commit()
    8. req.authname = remote_user
    9. req.outcookietrac_auth? = cookie
    10. req.outcookietrac_auth?path? = req.base_path or '/'
    Local variables: Name Value cookie 'aba89c5a0c29a2f81f18e3e4b92627da' cursor <trac.db.util.IterableCursor object at 0x91b2b9c> db <trac.db.pool.PooledConnection object at 0x913f92c> remote_user 'todd' req <Request "GET u'/login'"> self <traccas.traccas.CasLoginModule object at 0x8d52c2c>
  • File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/db/util.py", line 50, in execute Code fragment:
    1. def execute(self, sql, args=None):
    2. # -- In case of SQL errors, uncomment the following 'print' statements
    3. # print 'execute', repr(sql)
    4. if args:
    5. # print repr(args)
    6. return self.cursor.execute(sql_escape_percent(sql), args)
    7. return self.cursor.execute(sql)
    8. def executemany(self, sql, args=None):
    9. # print 'executemany', repr(sql)
    10. if args:
    Local variables: Name Value args ('aba89c5a0c29a2f81f18e3e4b92627da', 'todd', '192.168.208.103', ... self <trac.db.util.IterableCursor object at 0x91b2b9c> sql 'INSERT INTO auth_cookie (cookie,name,ipnr,time) VALUES (%s, %s, %s, %s)'
  • File "/opt/python/python2.5/lib/python2.5/site-packages/MySQL_python-1.2.3b1-py2.5-linux-i686.egg/MySQLdb/cursors.py", line 173, in execute Local variables: Name Value ListType <type 'list'> TupleType <type 'tuple'> args ('aba89c5a0c29a2f81f18e3e4b92627da', 'todd', '192.168.208.103', ... charset 'utf8' db <weakproxy at 0x92b0d24 to Connection at 0x937d5ac> exc <class '_mysql_exceptions.IntegrityError'> exc_info <built-in function exc_info> query "INSERT INTO auth_cookie (cookie,name,ipnr,time) VALUES ... self <trac.db.mysql_backend.MySQLUnicodeCursor object at 0x911efec> value IntegrityError(1062, "Duplicate entry ...
  • File "/opt/python/python2.5/lib/python2.5/site-packages/MySQL_python-1.2.3b1-py2.5-linux-i686.egg/MySQLdb/connections.py", line 35, in defaulterrorhandler Local variables: Name Value error (<class '_mysql_exceptions.IntegrityError'>, IntegrityError(1062, ... errorclass <class '_mysql_exceptions.IntegrityError'> errorvalue IntegrityError(1062, "Duplicate entry ...

File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py", line 435, in _dispatch_request

dispatcher.dispatch(req)

File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py", line 205, in dispatch

resp = chosen_handler.process_request(req)

File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/auth.py", line 101, in process_request

self._do_login(req)

File "build/bdist.linux-i686/egg/traccas/traccas.py", line 46, in _do_loginFile "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/auth.py", line 141, in _do_login

req.remote_addr, int(time.time())))

File "/opt/python/python2.5/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/db/util.py", line 50, in execute

return self.cursor.execute(sql_escape_percent(sql), args)

File "/opt/python/python2.5/lib/python2.5/site-packages/MySQL_python-1.2.3b1-py2.5-linux-i686.egg/MySQLdb/cursors.py", line 173, in executeFile "/opt/python/python2.5/lib/python2.5/site-packages/MySQL_python-1.2.3b1-py2.5-linux-i686.egg/MySQLdb/connections.py", line 35, in defaulterrorhandler

System Information:

User Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.7) Gecko/2009021906 Firefox/3.0.7 Trac: 0.11.3 Python: 2.5.4 (r254:67916, Feb 20 2009, 14:24:45) [GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] setuptools: 0.6c9 MySQL: server: "5.1.30-community-log", client: "5.0.45", thread-safe: 1 MySQLdb: 1.2.3b1 Genshi: 0.5.1 Subversion: 1.5.5 (r34862) jQuery: 1.2.6

Change History (0)

Note: See TracTickets for help on using tickets.