Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I ran a migration where I'd not yet mapped the bundle for the entity (because it was dynamic).
I accordingly got this result, as expected:
drush mi mymigration --limit=1 --update
Missing bundle for entity type node [error]
(core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php:83)
Processed 1 item (0 created, 0 updated, 1 failed, 0 ignored) - done [status]
with 'mymigration'
However, this left my migration map in a broken state: a map row was created with a source ID but no destination ID.
This means that subsequent migrations with --update crash, apparently because it tries to load an entity with a NULL id.
Comments
Comment #2
deepanker_bhalla CreditAttribution: deepanker_bhalla commentedHi,
It looked the same issue as mentioned below, thus kindly go through if it can help you out.
https://www.drupal.org/node/2678194
Comment #3
joachim CreditAttribution: joachim as a volunteer commentedThat's not quite the same issue.
I know where to put the bundle for the migration, which is the problem of the poster of that other issue.
This issue is about how Migrate should behave when that happens.
Comment #4
joachim CreditAttribution: joachim as a volunteer commentedThis is handling a little better on 8.3 -- I still get a map row which I don't think should happen, but an --update migration doesn't crash, it merely produces the same 'Missing bundle for entity type' message.
Comment #5
joachim CreditAttribution: joachim as a volunteer commentedComment #6
mikeryanThe existence of the map row is correct - the map table records all rows that are processed, with NULL destination IDs when there's an error or the row is explicitly ignored. You should be able to either rollback and reimport with a fixed migration, or as you are attempting use --update. Thus, the problem here isn't that the row exists in the map table, it's that running with --update after you've fixed the problem in the migration should result in a properly migrated entity and a map row with a normal status and destination ID.
Comment #7
joachim CreditAttribution: joachim as a volunteer commented> The existence of the map row is correct
On 8.1 this crashed, but on 8.3, doing an update just got me the same correctly reported error.
I've not tested 8.2. If the behaviour on 8.2 is the same as 8.3, then this can be closed as 'by design'.
Comment #9
mikeryanWith 8.3.0 coming out shortly, and as far as I can tell no further 8.2.x releases, there isn't going to be a backport of whatever the fix was to 8.2.x.