Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #424 (closed defect: duplicate)

Opened 13 years ago

Last modified 12 years ago

Logging in with a previous cookie causes crash

Reported by: bk2@… Owned by: anonymous
Priority: normal Milestone: 0.9
Component: Identity Version:
Severity: major Keywords: identity


Running TurboGears Build 534 -

I am noticing a bug in the visit system, when logging in when you

already have a cookie in your browser from a previous log-in.

Steps to Reproduce:

1) Start your project, using visit and identity (I'm using MySQL)

2) Open a browser, connect to your login page and login

3) Keep your browser open, but Restart your turbogears project

4) With the same browser, go to the login page and login again

This causes a really ugly error to come up from MySQL: "Page

Handler: Duplicate entry '1487' for key 2" (see below)

Closing the browser or deleting the cookie will make this error go away.

Might need a condition for a log-in when a cookie already exists?

I believe the expected behavior with a second login would be to replace the old cookie, or to re-associate the old cookie with the user from the new login.

  • Ben

Traceback Follows:

500 Internal error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Page handler: "Duplicate entry '1501' for key 2" Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cphttptools.py", line 96, in _run


File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/filters/init.py", line 131, in applyFilters


File "/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r534-py2.4.egg/turbogears/visit.py", line 107, in before_main

plugin.record_request( visit.id )

File "/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r534-py2.4.egg/turbogears/identity/visitor.py", line 157, in record_request

identity= self.identity_from_request(visit_id)

File "/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r534-py2.4.egg/turbogears/identity/visitor.py", line 83, in identity_from_request

identity= source(visit_id)

File "/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r534-py2.4.egg/turbogears/identity/visitor.py", line 137, in identity_from_form

identity= self.provider.validate_identity( user_name, pw, visit_id )

File "/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r534-py2.4.egg/turbogears/identity/soprovider.py", line 190, in validate_identity

link= TG_VisitIdentity( visit_id=visit_id, user_id=user.id )

File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1516-py2.4.egg/sqlobject/main.py", line 1197, in init

self._create(id, kw)

File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1516-py2.4.egg/sqlobject/main.py", line 1224, in _create


File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1516-py2.4.egg/sqlobject/main.py", line 1248, in _SO_finishCreate

id, names, values)

File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1516-py2.4.egg/sqlobject/dbconnection.py", line 752, in queryInsertID

return self._dbConnection._queryInsertID(

File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1516-py2.4.egg/sqlobject/mysql/mysqlconnection.py", line 78, in _queryInsertID

self._executeRetry(conn, c, q)

File "/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1516-py2.4.egg/sqlobject/mysql/mysqlconnection.py", line 60, in _executeRetry

return cursor.execute(query)

File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 137, in execute

self.errorhandler(self, exc, value)

File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line 33, in defaulterrorhandler

raise errorclass, errorvalue

IntegrityError?: 1062

Change History

comment:1 Changed 13 years ago by Max <ischenko@…>

  • Keywords identity added
  • Severity changed from normal to major

Looks like this is a duplicate of #415.

comment:2 Changed 13 years ago by Jeff Watkins

  • Status changed from new to closed
  • Resolution set to duplicate

This is a duplicate of #415.

Note: See TracTickets for help on using tickets.