- Issue created by @Anybody
- 🇩🇪Germany Grevil
Ok, the reason for the infinite loop resides somewhere inside
onPrepareRow()
in/src/EventSubscriber/MediaMigrationSubscriber.php
. Both runningdrush migrate-import --group=my_migration_group --continue-on-failure
anddrush migrate-upgrade --legacy-db-key=migrate --configure-only
led to the infinite loop.We tried deleting all migration ymls that were either provided or dependent on media_migration with no avail. After running the migration with minimal migration ymls in config the infinite loop still occured. Once we commented out the "onPrepareRow()" method call in the "MediaMigrationSubscriber" the migration started / the migration was configured successfully.
- 🇩🇪Germany Grevil
We found the issue!
This is caused by compatibility code for a core issue:
// @todo remove when https://drupal.org/i/3164520 is fixed. $process = [ [ 'plugin' => 'media_migration_delta_sort', 'source' => $field_name, ], ];
https://drupal.org/i/3164520 was already merged in 9.x, so no idea, why it suddenly causes an infinite loop in 11.x, but nevertheless, this should be fixed.
- Merge request !13Issue #3494209: Drupal 7 to Drupal 11 migration runs forever → (Open) created by Grevil
- 🇩🇪Germany Grevil
Waiting for 📌 Automated Drupal 11 compatibility fixes for media_migration Needs review to get fixed.
- 🇩🇪Germany Grevil
Setting back to major, as the module isn't d11 compatible yet anyway.
- 🇩🇪Germany Anybody Porta Westfalica
Pinged @heddn in 📌 Automated Drupal 11 compatibility fixes for media_migration Needs review . Thank you for finding this! I think we might want to merge this with the D11 compatibility issue or commit this one first.
- 🇩🇪Germany Anybody Porta Westfalica
Let's try with 📌 Optimize SQL queries RTBC additionally. Perhaps we have a crazy case...? (While this page is relatively small!)
- 🇩🇪Germany Grevil
Ok for some reason, the added array_map changes from https://git.drupalcode.org/project/drupal/-/merge_requests/1797/diffs?fi... in core migrate results in this issue. If we revert
getMigrationDependencies()
to how it was in D9: https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/modules/migr...drush migrate-import --group=my_migration_group --continue-on-failure
won't be stuck in an endless loop.I have no idea, how this module affects that line of code. I already commented out all code inside
MigratePluginAlterer
and in the module file. But it is still stuck in that endless loop, unless I comment out this modules MediaMigrationSubscriber "onPrepareRow" method. - 🇩🇪Germany Grevil
📌 Optimize SQL queries RTBC doesn't solve anything unfortunately.
- 🇩🇪Germany Grevil
Dirty core patch for the time being.
@Anybody and I will have a deeper look tomorrow.
- 🇩🇪Germany Grevil
Ok, to summarize this. The current MR has nothing to do with the problem and won't fix it.
I successfully migrated all the media to D11:
After applying "3494209-14.patch", I ran into 🐛 Migrations fail due to missing dependency when dependency has skipped rows by the source plugin Needs work , because with the patch applied, the dependencies seem to not get resolved correctly anymore. So I manually removed the failing dependencies. After that, a MigrateException was thrown in `/src/EventSubscriber/MediaMigrationSubscriber.php`, line 256.
I simply added a return statement above and everything worked as expected:
if (empty($final_source_field_name[0]['field_name'])) { return; throw new MigrateException( sprintf( "Cannot identify the the media entity's source field name" ) ); }
This is quite dirty, but everything seems to got migrated just fine! Of course we should find the real cause of this endeavour.