← Back to team overview

launchpad-dev team mailing list archive

Re: Bug 408528: Person, Account, and "email address is already registered."

 

On Monday 08 February 2010 13:55:35 Jeroen Vermeulen wrote:
> Translations is still being hit by a piece of fallout from the
> person/account split.  It gives us a few oopses a day, now that we know
> where to look for them.  I'm hoping that somebody from the Soyuz or
> Foundations teams might be able to help me understand what's going on.
> 
> The error is this one:
> 
> EmailAddressAlreadyTaken: The email address '...' is already registered.
> 
> It sometimes happens when our import code goes "look up the Person with
> this email address; or if there is none, create one."  The reason is
> that there may already be an Account with the given email address, but
> with no Person attached.  The attempt to create one fails because of the
> already existing objects.
> 
> AIUI a "Personless Account" is created for a user who creates an account
> but not on Launchpad.  We can't just create a Person for those cases,
> because the UI would then start claiming that the user was a Launchpad
>  user.
> 
> Also AIUI, the Soyuz team made their code recognize situations where a
> matching Person does exist, but is not attached to the Account that owns
> the email address.
> 
> So I'm left with several questions:
> 
>   * Is the Translations code's approach to the on-demand creation of
> persons wrong somehow?  We clearly want a Person here, not an Account.
> I could imagine having alternate references to "person or account,"
> but... yuck.
> 
>   * Is there a good way to deal with this without advertising people as
> Launchpad users when they're not?  A boolean for "uses Launchpad" has
> been suggested.
> 
>   * How can there be a matched combination of {Person, Account,
> EmailAddress} where the Person is not attached to the EmailAddress?  Is
> it a failure to update the preferred-email field?
> 
>   * Does that happen often?  If we detect a case like that and fix it
> up, can we hope for a lot of our oopses to go away?
> 
>   * If so, should those cases be prevented and cleaned up for all of LP
> instead of in individual apps that need it?
> 
> I'd greatly appreciate any light that anyone could shed on this.  I know
> it's been discussed before, but if nothing else, repeating what we know
> on the list will help us produce a better documentation trail.
> 
> 
> References:
> 
> https://bugs.launchpad.net/rosetta/+bug/411514
> https://bugs.launchpad.net/launchpad-foundations/+bug/408528



Soyuz just uses this:

            person = getUtility(IPersonSet).ensurePerson(
                email, name, PersonCreationRationale.SOURCEPACKAGEUPLOAD,
                comment=('when the %s_%s package was uploaded to %s'
                         % (package, version, policy_suite)))

Celso did a fix to ensurePerson() a while ago now and we've not had any 
problems since.



Follow ups

References