"get() returned more than one User" when attempting to login

Bug #1007281 reported by Michael Nelson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Software Center Agent
Fix Released
High
Michael Nelson
django-openid-auth
Fix Released
Undecided
Anthony Lenton

Bug Description

This looks similar to the fixed bug 701209 - but in fact it's not.

When logging in to purchase software or retreive software with a coupon, we are sometimes oopsing because of duplicate *usernames*:

Traceback: https://pastebin.canonical.com/67271/

We had lots of these occurring on 2012-05-31, but I don't (yet) see any other occurrences in May.

Related branches

description: updated
Changed in software-center-agent:
assignee: nobody → Michael Nelson (michael.nelson)
description: updated
Changed in software-center-agent:
assignee: Michael Nelson (michael.nelson) → nobody
Revision history for this message
Michael Nelson (michael.nelson) wrote :

After some investigation, it seems the reason for the duplicate usernames is two-fold:

First, we've lost the unique constraint on auth_user.username with the 0038_django_contrib_auth_user_username_longer migration:

https://pastebin.canonical.com/67286/

And second, although I'm not yet able to demonstrate, the django_openid_auth.auth._get_available_username() method is racey - returning the same available username. I'm not yet certain that this second point is the reason for the duplicate usernames, but I haven't yet found occurrences of this bug before 2012-05-31.

description: updated
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Indeed, in South 0.7.3 (what's installed for sca [1]), alter_column does not support unique constraints or indexes [2].

[1] https://pastebin.canonical.com/67290/
[2] http://south.readthedocs.org/en/latest/databaseapi.html#db-alter-column

Changed in django-openid-auth:
status: New → In Progress
assignee: nobody → Anthony Lenton (elachuni)
Changed in django-openid-auth:
status: In Progress → Fix Committed
Dave Morley (davmor2)
Changed in django-openid-auth:
status: Fix Committed → Fix Released
Changed in software-center-agent:
status: Confirmed → Fix Released
assignee: nobody → Michael Nelson (michael.nelson)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.