I've run into a situation where errors were thrown in a complete() handler, for users and comments. Beyond the error itself, it caused me all sorts of grief:

  1. Users were successfully saved, then errors were thrown in complete().
  2. Because we had errors, the map table stored NULL for destid1.
  3. Thus, the created users could not be rolled back - the map table didn't know the Drupal accounts exist.
  4. The subsequent comment migration attempted to identify authors with sourceMigration(), failing because the matching map table entries had no destid1 (uid), so incorrectly ended up as anonymous.
  5. Rerunning the comment migration after fixing the source of the error created duplicate comments - because the comment map table didn't keep track of the originally-created comments, it created new ones.

So, we need to find a way to prevent the inconsistent state of entities being created by migration but not recorded in the map table. Either convert the errors to informational messages and proceed down the normal "success" path, or delete the created entity then and there...

Comments

mikeryan’s picture

Status: Active » Fixed

OK, any exceptions thrown in complete() will now be cleanly saved to the message table, not affecting the imported status of the entity.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.