Problem/Motivation
Have Drupal 9 site with custom migrations defined with shared configuration (Using MigrationGroup configuration provided by Migrate Plus module)
migrate 9.1.10
migrate_plus 8.x-5.1
migrate_tools 8.x-5.0
migrate_source_csv 8.x-3.4
All migrations will fail if status of migrations are listed or performing any of the migration processes with following error message:
In DiscoveryTrait.php line 53:
The "" plugin does not exist. Valid plugin IDs for Drupal\migrate\Plugin\MigrateSourcePluginManager are: embedded_data, empty, table, url, csv, d7_responsive_image_styles
Root cause for the error is MigrationHelper::alterPlugins() method introduced in 8.x-1.0-rc9 that assumes that every migration includes full set of configuration in its config file. MigrationHelper::alterPlugins() fails if $migration['source']['plugin'] is missing from the config file.
It's quite common when migrating content from csv file (as an example) that most of the migration configuration is handled using MigrationGroup configuration entities provided by Migrate Plus module.
Steps to reproduce
- Install (at least) migrate, migrate_plus, migrate_tools
- Create custom migration that has migration_group defined
- Add source related configuration to group config as shared_configuration.
- Enable custom migration
- Try to check status of migration
Status check of migration will fail if actual migration config file does not have ['source']['plugin'] defined (included in shared_configuration instead)
Proposed resolution
See attached patch that integrates shared group configuration into the migration.
Comment | File | Size | Author |
---|---|---|---|
#28 | 3221074-14.patch | 2.25 KB | drupalam |
#3 | interdiff_1_3.txt | 1.68 KB | mitrpaka |
#3 | 3221074_3.patch | 2.28 KB | mitrpaka |
| |||
MigrationHelper_alterPlugins.patch | 2.45 KB | mitrpaka | |
Issue fork inline_entity_form-3221074
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mitrpaka CreditAttribution: mitrpaka as a volunteer commentedPatch updated.
Comment #4
mitrpaka CreditAttribution: mitrpaka as a volunteer commentedComment #5
geek-merlinThanks a lot! I added some related issues and it seems one of the latest patches did a regression.
Tbh i don't grok the migration plugin descriptor structure you're handling, but the code looks like you know what you are doing.
Tests are green. So LGTM.
Does this fix the issue for you?
I also pointed people in the related issues (with some suppress-only patches) to this one to maybe get additional feedback.
Also, if you can push to an issue branch, it will significantly make it easier to merge ;-).
Comment #6
brockfanning CreditAttribution: brockfanning commentedJust wanted to say that I also got hit by the bug, and this patch fixed it for me. Thank you!
Comment #7
matslats CreditAttribution: matslats as a volunteer commentedStill not working for me I'm afraid, the patch makes no difference at all to the error or to the process plugins.
The new function getMigrationWithSharedConfiguration runs and it seems to me that the problems is with the altered structure of migration processes.
Do I need this to work to upgrade from D7 Ubercart?
Comment #8
IT-CruPatch from #3 also works for us to fix this issue.
Comment #9
rescandon CreditAttribution: rescandon at Four Kitchens commentedThe patch is fixing the error. Thank you.
Comment #10
KarlSheaIt's also breaking migrations for me in a similar way as #7.
Comment #11
greenSkin CreditAttribution: greenSkin as a volunteer commentedI ran into a similar issue described in #7. Inline Entity Form module doesn't cover the case if the migration already defines the additional settings process for inline_entity_form, or more specifically whether the settings process array is a plugin or is an array of plugins. This patch checks to see if "plugin" key exists, if it does then it is wrapped inside an array prior to merging the addition rather than always wrapping the result inside an array.
Comment #12
nginex CreditAttribution: nginex for Dropsolid commentedHere is small improvement for #3 patch
Comment #13
junaidpvPatch from #11 helped. Thanks!
Comment #14
thatguy CreditAttribution: thatguy at Siili Solutions commentedPatch from #11 fixed the issue for me
Comment #15
geek-merlinComment #16
junaidpv#11 no longer helps me! I required to apply change suggested in #3208995: Alter plugins results in empty string which is invalid plugin ID instead.
Comment #17
geek-merlin> #11 no longer helps me!
What does this mean? Does it apply? What happens? What about #12?
Comment #18
junaidpvIt does apply, but it keeps throwing "The "" plugin does not exist." error.
Same for #12 as well.
Comment #25
LysenkoHi, I made this MR !49 in order to avoid creating the instance of the source plugin of the migration.
Because when we create an instance of the source plugin it inits the query to the source of the migration that
occurs issues when the migration source is not reachable.
For example, API is not available from the local machine.
The patch was created in contributing with @alt.dev it would be great if he will get a credit as well.
Comment #26
drupalam CreditAttribution: drupalam as a volunteer and commentedHello there
Can we reroll please? This patch is no longer working for me on Drupal 9.4.4.
https://www.drupal.org/files/issues/2021-11-19/3221074-12.patch
This is the reject file. There is an error given on composer update however most of the patch is applied.
MigrationHelper.php.rej
Comment #27
drupalam CreditAttribution: drupalam as a volunteer and commentedI have updated this patch based on the newest version of the module 1.0.0@rc12
https://www.drupal.org/files/issues/2022-08-01/3221074-13.patch
Comment #28
drupalam CreditAttribution: drupalam as a volunteer and commentedLatest patch file which works with the latest version of this module.
https://www.drupal.org/files/issues/2022-08-01/3221074-14.patch
Comment #29
geek-merlinToo many migration issues, many of which look overlapping or duplicate.
Postponing on parent issue.
Comment #30
AnybodyHi @Axel,
settings this back to active as of #3275819: Provide useful error message for: The "" plugin does not exist on Drupal 6 / 7 migrations which we just ran into. The migrations were created with 8.x-1.0-rc12, so I'm updating the version. We can set this to 8.x-1.x-dev if they are same, @Grevil will check if 8.x-1.x-dev gives better results tomorrow.
I guess this might also be the root cause of: https://www.reddit.com/r/drupal/comments/of145l/the_plugin_does_not_exis...
Comment #31
AnybodyThis is major as it breaks migrations and is hard to find!
Comment #32
AnybodyOk we can safely set this to 8.x-1.x-dev. src/MigrationHelper.php is the same in rc12 and 8.x-1,x-dev (not changed since 12 months) so this is definitely still an issue!
With inline_entity_form enabled, this is what changes:
Comment #33
geek-merlinPlease read the parent issue before acting.
Comment #34
AnybodyThanks @geek-merlin, you're right. I'm going to help cleaning and clearing things up as good as possible.
Comment #35
Anybody@geek-merlin: From my perspective, we should set this issue "Needs review", as after checking all sibling issues from the parent task, this one is separate and there's no duplicate for this issue anymore.
If you agree, would you do that?
Next steps are to compare the approach from #28 (3221074-14.patch) to the approach from MR!49, which use very different implementations!
@Lysenko wrote in #25:
Sorry, but I don't really get the point here. Could you or someone else please compare the outcome of both patches and tell, which one is better to proceed with?
Do we have an inline_entity_form maintainer with deeper migration knowledge, we could ask for having a look?
Comment #37
geek-merlinThanks Anybody for the thorough cleanup!
I have reviewed everything.
Short verdict: Move on with #28.
Triggered bot and #28 still applies and is green.
MRs 48/49 take the work of #28 and adds lots of unrelated changes. I doubt that something useful is in there, but if it is, it's not reviewable.
(Unrelated comment: People told me that there is a current discussion what the contribution point system encourages.)
Comment #38
Anybody@everyone here, receiving this notification and anyone coming here with this issue, could you please check and confirm if the patch from #28 fixes the issue for you?
We didn't run into this situation and @geek-merlin also didn't, I guess, so we need someone to try, if this is the correct solution.
All related migration fixes are now in 8.x-1.x-dev, this is currently the last open migration issue here. Please help to fix it.
@geek-merlin, what do you think about a new 8.x-1.0-rc13 release from current dev? So less people may run into the fixed issues...
I don't think this issue will be solved on the short term...
Comment #39
geek-merlin> @geek-merlin, what do you think about a new 8.x-1.0-rc13 release from current dev?
Agree once we have the other issue where you test on a migration ;-)
Comment #40
geek-merlin@Anybody, you groked all the migration issues... We have this patch #11 which looks unrelated here, but relevant.
Can you cross-check if that's in one of the other migraiton patches?
Comment #41
geek-merlinAlso we have a relevant question in #8:
> Do we really need to provide an own getMigrationWithSharedConfiguration() or does migrate module provide such method in some way?
Comment #42
Anybody@geek-merlin: Re #40: #11 looks to me like a duplicate of the already committed https://git.drupalcode.org/project/inline_entity_form/-/commit/748816b from #3213595: MigrationHelper::alterPlugins assumes settings isn't already an array
Re #41 I'm sadly not able to answer this. We didn't run into such issues, so I think someone else has to pick this up from here... or maybe this is magically solved by the other fixes, but I don't think that's realistic from a code perspective.
Over and out here (if we shouldn't run into these issues sooner or later).
Comment #43
geek-merlinThx! So we're at #38: Please someone(tm) test if the patch in #28 fixes the issue for them.
Comment #44
PCate CreditAttribution: PCate commented#28 fixed the migrated error for me. Tested with 8.x-1.0-rc12.
Comment #45
geek-merlinComment #47
geek-merlinSo the last migration bug is hereby fixed, thanks all!
Tagging rc13 release.
Comment #48
AnybodyThank you very much, Axel! :) I hope we'll see no regression. inline_entity_form was a huge part of our migration issues, so it's great to see this should be fixed now. Thanks for the important release!