Comment 0 for bug 411514

Revision history for this message
Данило Шеган (danilo) wrote : Silent PO import failures: EmailAddressAlreadyTaken

Similarly to bug #408528 in Soyuz, when we are importing translations from people who have not registered in Launchpad (i.e. there is no Person record for them), but who do have an account (i.e. there is Account and EmailAddress record for them), imports fail with

Traceback (most recent call last):
  File "/srv/launchpad.net/production/launchpad-rev-8325/lib/lp/translations/scripts/po_import.py", line 104, in run
    (mail_subject, mail_body) = (
  File "/srv/launchpad.net/production/launchpad-rev-8325/lib/lp/translations/model/pofile.py", line 1026, in importFromQueue
    errors, warnings = (
  File "/srv/launchpad.net/production/launchpad-rev-8325/lib/lp/translations/utilities/translation_import.py", line 335, in importFile
    file_importer = POFileImporter(
  File "/srv/launchpad.net/production/launchpad-rev-8325/lib/lp/translations/utilities/translation_import.py", line 692, in __init__
    self.last_translator = self._getPersonByEmail(email, name)
  File "/srv/launchpad.net/production/launchpad-rev-8325/lib/lp/translations/utilities/translation_import.py", line 741, in _getPersonByEmail
    displayname=name, comment=comment)
  File "/srv/launchpad.net/production/launchpad-rev-8325/lib/lp/registry/model/person.py", line 2459, in createPersonAndEmail
    email = getUtility(IEmailAddressSet).new(
  File "/srv/launchpad.net/production/launchpad-rev-8325/lib/canonical/launchpad/database/emailaddress.py", line 116, in new
    raise EmailAddressAlreadyTaken(
EmailAddressAlreadyTaken: The email address '...' is already registered.

Discussing this with Salgado, the problem is that we are using Account/Person split to indicate if someone has explicitely registered to use Launchpad or not. Yet, in Translations we do need Person records, so we need to create them anyway.

Proper, long-term fix will involve adding separate field to person records indicating whether that person is using LP or not (i.e. it was created automatically). As a short-term fix, we can add Person records with a new creation rationale like POFILEIMPORT_NOTYETUSINGLAUNCHPAD (and equate it to POFILEIMPORT wherever we are using POFILEIMPORT).

To help with a test case, we have seen this with French upload at https://translations.launchpad.net/felo/+imports

Work-around for users: modify Last-Translator to use a different email address, preferrably of the same person. Note that translations will be creditted to Last-Translator, so if you get it wrong, a wrong person might get the credit for somebody else's work.