IntegrityError raised merging people

Bug #595164 reported by Diogo Matsubara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Unassigned

Bug Description

As seen on OOPS-1626B636 an IntegrityError: duplicate key value violates unique constraint "account_openid_identifier_key" was raised while the user was trying to merge accounts.

Related branches

Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: New → Triaged
importance: Undecided → High
milestone: none → 10.06
Revision history for this message
Curtis Hovey (sinzui) wrote :

The user in this case created two profiles in the same day, possibly via two seperate logins from SSO. All 6 errors were cause by him from 3 different logintokens.

The code adds a 'merged-' prefix to the old account to prevent the OpenID identifier from being used. The identifier was unique. we are certain because of the '-' in the prefix, that it is not possible for it to be accicentally generated. The renamed identifier also exceeds the length of the generated identifier.

It is possible that the account identifier was once used, someone merge the account, This user got the same identifier, then tried a merge. This is a legitimate scenario, though I would have expected such an event to be unlikely to happen in 10 years--it happened in 2 weeks.

Revision history for this message
Curtis Hovey (sinzui) wrote :

I have looked at the data synced on staging and I can confirm that the openid identifier was indeed reused after it was freed and renamed to 'merged-*'. The code needs a mechanism to create a unique merged openid indentifier. I propose we use the datetime to ensure no collision.

Curtis Hovey (sinzui)
Changed in launchpad-registry:
assignee: nobody → Curtis Hovey (sinzui)
status: Triaged → In Progress
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: In Progress → Fix Committed
tags: added: qa-needstesting
Curtis Hovey (sinzui)
tags: added: qa-ok
removed: qa-needstesting
Revision history for this message
Ursula Junque (ursinha) wrote : Bug fixed by a commit
tags: added: qa-needstesting
removed: qa-ok
Ursula Junque (ursinha)
tags: added: qa-ok
removed: qa-needstesting
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
Changed in launchpad:
assignee: Curtis Hovey (sinzui) → nobody
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.