Problem/Motivation
When I run
drush migrate:import upgrade_d7_field_instance --migrate-debug
upgrade_d7_field_instance yml is generated by migrate upgrade without any modification,
I have the following errors:
In DiscoveryTrait.php line 53:
The "" plugin does not exist. Valid plugin IDs for Drupal\migrate\Plugin\Mi
gratePluginManager are: addressfield, block_plugin_id, block_region, block_
settings, block_theme, block_visibility, field_type, process_field, field_f
ormatter_settings_defaults, d6_field_instance_defaults, d6_field_instance_o
ption_translation, d6_field_field_settings, field_instance_widget_settings,
d6_field_option_translation, field_settings, d6_field_type_defaults, field
_bundle, d7_field_instance_defaults, d7_field_instance_option_translation,
d7_field_instance_settings, d7_field_option_translation, d7_field_settings,
d7_field_type_defaults, d7_field_permission_settings, d6_field_file, file_
uri, filter_id, filter_settings, filter_format_permission, geofield_d7d8, g
eofield_field_settings, geofield_latlon, geofield_wkt, google_analytics_vis
ibility_pages, google_analytics_visibility_roles, d6_imagecache_actions, in
line_entity_form_field_instance_settings, field_link, link_options, link_ur
i, d6_nodewords_entities, d7_metatag_entities, array_build, callback, conca
t, default_value, download, entity_exists, explode, extract, file_copy, fla
tten, format_date, get, log, machine_name, make_unique_entity_field, menu_l
ink_parent, migration_lookup, null_coalesce, route, skip_on_empty, skip_row
_if_not_set, static_map, sub_process, substr, urlencode, debug, node_comple
te_node_lookup, node_complete_node_revision_lookup, node_complete_node_tran
slation_lookup, array_pop, array_shift, default_entity_value, dom, dom_appl
y_styles, dom_migration_lookup, dom_remove, dom_select, dom_str_replace, en
tity_generate, entity_lookup, entity_value, file_blob, gate, merge, multipl
e_values, service, single_value, skip_on_value, str_replace, transliteratio
n, transpose, node_update_7008, path_set_translated, d6_url_alias_language,
d6_path_redirect, d7_path_redirect, d7_redirect_source_query, search_confi
guration_rankings, system_update_7000, timezone, forum_vocabulary, convert_
tokens, profile_field_settings, user_langcode, user_update_8002, d6_profile
_field_option_translation, user_update_7002, field_collection_field_instanc
e_settings, field_collection_field_settings, paragraphs_field_instance_sett
ings, paragraphs_field_settings, paragraphs_lookup, paragraphs_process_on_v
alueSteps to reproduce
There can be various reasons like core or contrib module bugs or migration misconfigurations causing this error message.
The problem is, that the error message is useless as it contains no helpful information WHAT went wrong WHERE.
Proposed resolution
Add more details to the error message, so the message is helpful and allows finding the root cause of the error.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | patch-26.patch | 2.08 KB | grevil |
Issue fork drupal-3275819
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 #2
Kenzomus commentedComment #3
inder_jeet commentedI have the same problem. Does anyone have a solution?
Comment #4
fonant commentedMe too. Can't see any empty "plugin" lines in the YAML.
Comment #5
antonioluqueparlon commentedI,ve got the same problem, any solution for this?
Comment #6
antonioluqueparlon commentedhttps://www.reddit.com/r/drupal/comments/of145l/the_plugin_does_not_exis...
here's the fix. In my case resolved the problem
Comment #7
anybodyI can confirm we're running into the same issue with 4.0.0 when migrating a Drupal 7 site to Drupal 9.
The reddit issue from #6 (https://www.reddit.com/r/drupal/comments/of145l/the_plugin_does_not_exis...) says:
In migrate_plus.migration.upgrade_d7_field_instance.yml the lines
should be
Now the question is, which version is correct and where the wrong one comes from or why it fails. Any ideas?
But first, please see the module page of migrate_upgrade:
As of this, I'll now move the issue over to Drupal core.
Comment #8
anybodyComment #9
quietone commented@Kenzomus, when making an issue on drupal.org, add your details in the Problem section and leave the rest. Those headers are there to help us keep track of the work to do.
The d7_field_instance migration is well, a field, migration and can be altered by contrib and custom code. We need more information to narrow this down. Can you identify the field or fields instances that are not being created? In particular, knowing the field type (like paragraphs) is needed.
Comment #10
anybodyThanks, @quietone we'll also try to help to track this issue down, as we were running into it on a large Drupal 7 to Drupal 9 migration. We'll try to provide all possible details.
Comment #11
anybody@quietone, I think the first part here, wherever it is caused, should be to improve the error message. We're now running into this again, but you can't see which migration triggers the error.
This is the drush output:
As I guess the error appears AFTER upgrade_d7_taxonomy_vocabulary it would be super helpful to see in which migration fails. Having a look into the Migration.php file, I think the value given is already empty, which we might add a check for, so it's not passed to the plugin loading at all?
I'll try that...
Comment #13
anybodyCreated a MR which throws an exception if the 'plugin' key is missing or has an empty value. First it was an
!isset()check, but I thinkempty()is safer here, if the key is present, but has an empty value. Guess there will never be a plugin called "", 0 or something like that.I found #3248350: Migrate Module: Notice: Undefined index: plugin in Drupal\migrate\Plugin\Migration->findMigrationDependencies() (line 641 of core/modules/migrate/src/Plugin/Migration.php). which is somehow related, improving the error handling may help to find the failing / broken migration. So we can later decide if we implement the error handling here or in the other issue.
This doesn't solve the root cause reported here yet, but if running into such an error, will help to track things down! So I'd definitely vote for adding error handling here.
BTW additionally to the issue reported here, we're also experiencing
when starting the migration using
drush migrate:import --group=my_migrate_groupnot only during the migration.The migrations were generated using
drush migrate:upgrade --legacy-db-key=migrate --configure-onlyfrom a Drupal 7 website.Comment #14
anybodyOkay, here we have the results:
For more details, I locally changed the line from the MR to:
and it throws the following Exception when running
drush migrate:import --group=my_migrationwhich confirm the assumptions from this issue and we're running into the same issue.
Comment #15
anybodyI guess this might be related / the reason? #3221074: Implemented hook_migration_plugins_alter() breaks migrations, if shared configuration used in migration configs.
Comment #16
anybody@quietone: 100% sure now, that this is NOT a core issue and inline_entity_form causes this in: #3221074
BUT as written above I'd really vote to improve the error handling for such cases, which isn't good here, as the comments above demonstrate.
How should we proceed? Create a follow-up with the proposed error handling from MR!2706 or should we first discuss further steps here by example or even use this issue, as it shows why this is needed?
Of course, we should then also add a failing test for broken migration config like this triggering the exception:
Thanks :)
Comment #17
anybodyComment #18
anybodyComment #19
grevil commentedWe forgot to change the status of this issue!
Comment #20
grevil commentedAlready tested it for our custom d7 Migration, does what it should do!
I just noticed, that this is also relevant for d6 Migrations, I'll test if the MR provided will also fix it for d6!
Comment #21
grevil commentedOk, I just tested the d6 to d9 migration, with the patch applied and instead of
The "" plugin does not exist., I know getMissing 'plugin' property for 'options/type' in migration: 'upgrade_d6_field_formatter_settings'!So also works as expected for d6. :)
PS: Couldn't find a migration tag for drupal 7 to drupal 8+, also the tag names seem to be kinda deprecated (no sign of drupal 9 / drupal 10 migration)
Comment #22
anybodyUpdated the issue title and issue summary. This issue (and the patch) is not about fixing such issues, but about providing helpful information WHAT went wrong WHERE.
One typical CAUSE for this issue can be found in #16. The root cause is not a core issue, but core should be more helpful to provide error details.
It shows that
$configuration['plugin']can be empty, but is expected to exist and used in the next lines, so better error handling is required.Comment #23
quietone commentedThanks for moving this forward!
This issue does not need any special tags. The tags 'migrate-d6-d8' and 'migrate-d7-d8' are for migrations specific to d6 or d7 sources. The proposed change here is in migrate, which will apply to migrations from any source.
This will also need tests, adding tag and setting to NW for that.
I haven't reviewed the patch yet.
Comment #24
anybody@quietone thanks! We'll also add tests here to trigger the Exceptions using a wrong configuration.
I guess it would make sense, if you had a short look at the MR first, to decide if the way we do it is okay?
Comment #25
anybodyComment #26
grevil commentedHere is a static patch file for the time being, if anyone needs it.
Comment #29
grevil commentedPatch from #26 still perfectly applies on 11.x.
Comment #30
anybodyAlso with this patch enabled, the root cause seems to be that an array containing the plugin arrays is passed to the method where we added the exception.
The array with the "plugin" key is one level deeper. The question is, why this happens!
Example:
drush migrate:import --group=xyz --continue-on-failurethrows this exception with the patch applied
because the following array in array is passed:
In Migration.php line 733:
The .yml part looks like this:
which seems correct?
Is this eventually caused by another patch we use?
Comment #31
quietone commentedComment #32
proweb.ua commented@anybody
maybe it will help
https://www.drupal.org/project/drupal/issues/2914251#comment-15407690
Comment #33
quietone commentedThe Migrate Drupal Module was approved for removal in #3371229: [Policy] Migrate Drupal and Migrate Drupal UI after Drupal 7 EOL.
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3522602: [meta] Tasks to remove Migrate Drupal module and the removal work in #3522602: [meta] Tasks to remove Migrate Drupal module.
Migrate Drupal will not be moved to a contributed project. It will be removed from core after the Drupal 12.x branch is open.