Needs work
Project:
Media Migration
Version:
8.x-1.x-dev
Component:
Documentation
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Dec 2024 at 11:42 UTC
Updated:
22 Jul 2025 at 14:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
grevil commentedOk, 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-failureanddrush migrate-upgrade --legacy-db-key=migrate --configure-onlyled 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.
Comment #3
grevil commentedWe will take a deeper look soon.
Comment #4
grevil commentedWe found the issue!
This is caused by compatibility code for a core issue:
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.
Comment #7
grevil commentedWaiting for #3431903: Automated Drupal 11 compatibility fixes for media_migration to get fixed.
Comment #8
grevil commentedBut this can already get reviewed.
Comment #9
grevil commentedSetting back to major, as the module isn't d11 compatible yet anyway.
EDIT: Although this might happen in d10 as well.
Comment #10
anybodyPinged @heddn in #3431903: Automated Drupal 11 compatibility fixes for media_migration. Thank you for finding this! I think we might want to merge this with the D11 compatibility issue or commit this one first.
Comment #11
grevil commentedBug is back on the table...
Comment #12
anybodyLet's try with #3209706: Optimize SQL queries additionally. Perhaps we have a crazy case...? (While this page is relatively small!)
Comment #13
grevil commentedOk 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-failurewon'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
MigratePluginAltererand in the module file. But it is still stuck in that endless loop, unless I comment out this modules MediaMigrationSubscriber "onPrepareRow" method.Comment #14
grevil commented#3209706: Optimize SQL queries doesn't solve anything unfortunately.
Comment #15
grevil commentedDirty core patch for the time being.
@Anybody and I will have a deeper look tomorrow.
Comment #16
grevil commentedComment #17
grevil commentedOk, 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 #2797505: Migrations fail due to missing dependency when dependency has skipped rows by the source plugin, 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:
This is quite dirty, but everything seems to got migrated just fine! Of course we should find the real cause of this endeavour.
Comment #20
grevil commentedOK, to quickly summarize my actions here:
NONE of the issue branches properly fix this problem!!!
I did a "successful" migration to D11 using the following patches:
Media Migration Patches:
Drupal core Patches:
This is definitely not the proper way to do this, but it seems to do the job just fine. The real cause of this issue still needs to be found.
Comment #21
heddnI've opened #3537372: Calling $migration->getMigrationDependencies() from a field plugin results in an infinate loop.