"get() returned more than one User" when attempting to login
Bug #1007281 reported by
Michael Nelson
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:/
We had lots of these occurring on 2012-05-31, but I don't (yet) see any other occurrences in May.
Related branches
lp:~elachuni/django-openid-auth/race-condition
- Ricardo Kirkner: Approve
- Michael Hall: Approve
-
Diff: 176 lines (+74/-4)4 files modifiedREADME.txt (+11/-0)
django_openid_auth/auth.py (+14/-2)
django_openid_auth/tests/test_auth.py (+30/-0)
django_openid_auth/tests/test_views.py (+19/-2)
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 |
Changed in django-openid-auth: | |
status: | New → In Progress |
assignee: | nobody → Anthony Lenton (elachuni) |
Changed in django-openid-auth: | |
status: | In Progress → Fix Committed |
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.
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.