Modify

Opened 6 years ago

Last modified 21 months ago

#4784 new defect

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

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

Description (last modified by rjollos)

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) ` [[br]] `[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:
       430. try:
       431. if not env and env_error:
       432. raise HTTPInternalError(env_error)
       433. try:
       434. dispatcher = RequestDispatcher(env)
       435. dispatcher.dispatch(req)
       436. except RequestDone:
       437. pass
       438. resp = req._response or []
       439.  
       440. 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:
       200. req.args.get('__FORM_TOKEN') != req.form_token:
       201. raise HTTPBadRequest('Missing or invalid form token. '
       202. 'Do you have cookies enabled?')
       203.  
       204. # Process the request and render the template
       205. resp = chosen_handler.process_request(req)
       206. if resp:
       207. if len(resp) == 2: # Clearsilver
       208. chrome.populate_hdf(req)
       209. template, content_type = \
       210. 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:
        96. def match_request(self, req):
        97. return re.match('/(login|logout)/?$', req.path_info)
        98.  
        99. def process_request(self, req):
       100. if req.path_info.startswith('/login'):
       101. self._do_login(req)
       102. elif req.path_info.startswith('/logout'):
       103. self._do_logout(req)
       104. self._redirect_back(req)
       105.  
       106. # 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:
       136. cookie = hex_entropy()
       137. db = self.env.get_db_cnx()
       138. cursor = db.cursor()
       139. cursor.execute("INSERT INTO auth_cookie (cookie,name,ipnr,time) "
       140. "VALUES (%s, %s, %s, %s)", (cookie, remote_user,
       141. req.remote_addr, int(time.time())))
       142. db.commit()
       143.  
       144. req.authname = remote_user
       145. req.outcookie['trac_auth'] = cookie
       146. req.outcookie['trac_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:
        45. def execute(self, sql, args=None):
        46. # -- In case of SQL errors, uncomment the following 'print' statements
        47. # print 'execute', repr(sql)
        48. if args:
        49. # print repr(args)
        50. return self.cursor.execute(sql_escape_percent(sql), args)
        51. return self.cursor.execute(sql)
        52.  
        53. def executemany(self, sql, args=None):
        54. # print 'executemany', repr(sql)
        55. 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

Attachments (0)

Change History (1)

comment:1 Changed 21 months ago by rjollos

  • Description modified (diff)

Add Comment

Modify Ticket

Action
as new The owner will remain coderanger.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.