Problem/Motivation
When running a migration from Drupal 6 to Drupal 8 beta 2 with the latest 7-dev Drush I got an exception when filefield is reached:
exception 'Drupal\migrate\MigrateException' with message 'Failed to [error]
lookup array (
0 => 'filefield',
1 => 'thumb_default',
) in the static map.' in
/var/www/vhosts/d8/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FieldTypeDefaults.php:33
Stack trace:
#0
/var/www/vhosts/d8/core/modules/migrate/src/MigrateExecutable.php(398):
Drupal\migrate_drupal\Plugin\migrate\process\d6\FieldTypeDefaults->transform(Array,
Object(Drupal
etc.
FileField Version is 6.x-3.10.
Any more information I can provide?
Thanks and best regards,
Rainer for proxiss
Proposed resolution
To skip the row rather than fatal error when the lookup in the static map misses for the field type.
Remaining tasks
Create a patch.
Comment | File | Size | Author |
---|---|---|---|
#45 | skip_the_row_when_we-2361401-45.patch | 2.9 KB | svendecabooter |
#41 | skip_the_row_when_we-2361401-41.patch | 2.81 KB | neclimdul |
#41 | 2361401-41.interdiff.txt | 1.06 KB | neclimdul |
#40 | 2361401-39.interdiff.txt | 1.74 KB | neclimdul |
#39 | 2361401-39.interdiff.txt | 0 bytes | neclimdul |
Comments
Comment #1
proxiss CreditAttribution: proxiss commentedOk, i tried some things now:
Starting over with a blank install in english.
=> Import fails like before
Then I removed to filefield from my Drupal 6 site and resetted everything. Next run:
I removed d6_field_formatter_settings from manifest.yml.
Next try got this:
I removed d6_vocabulary_field_instance
Next try this:
Then it run through with tons of warnings and errors and ended up like this:
Users were migrated, but no roles. No Content, no content types, no taxonomies. Blocks were migrated but completely wrong. No books were migrated, no contact forms, no menus etc.
This is really pain in the ass and the hell of an alpha state. I'll try again in some weeks.
Regards,
Rainer
Comment #2
svendecabooterI get the same error:
Fatal error: Call to a member function getConfigDependencyName() on a non-object in drupal/core/lib/Drupal/Core/Entity/EntityDisplayBase.php on line 165
It seems this is being worked on in issue #2346039: Add missing migrations to MigrateDrupal6Test and fix the result, so you might follow along there.
Comment #3
ultimikeHmm - I'm getting hit with this issue as well. Here's the relevant part of my
drush migrate-manifest
output.I think this is related to ImageField (contrib module) display settings. Just for kicks, I added
hidden: filefield_default
to d6_field_formatter_settings.yml (see attached diff for details) and re-ran the migration, on the next pass, I got the exception:400px_wide_imagelink
is a custom image style formatter on my site.I'm not sure of the best way to handle this - maybe skip the migration when the field formatter type is not found (instead of throwing an exception)?
-mike
Comment #4
ultimikeAh drat - forgot the diff in my last comment. Attached here.
-mike
Comment #5
benjy CreditAttribution: benjy commentedAs discussed on the call today, we're going to skip the row rather than fatal error when the lookup in the static map misses for the field type.
Comment #6
areke CreditAttribution: areke commentedComment #7
Tom Elwertowski CreditAttribution: Tom Elwertowski commentedHere is some info possibly related to #2349701: FieldTypeDefaults, Uncaught PHP Exception which was closed and redirected here.
The following error occurs for me whenever a Content types > Display fields view mode is set to <Hidden>. Once all are unhidden, my migration proceeds.
Comment #8
benjy CreditAttribution: benjy commentedHow about we just update the exception to skip the row, like the attached.
Comment #9
quietone CreditAttribution: quietone commentedApplied patch and passed tests. Simple patch that looks good and doesn't break anything.
Note that I wasn't able to reproduce the original error, but I tested running 8.0.x. I went ahead and tested any way as I'm leaving for a week long conference today.
Comment #10
ultimikeSeems like we need a test for this patch...
-mike
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedI've been encountering the same problem with a D6 database which uses imagefield. I tried the patch in #8, and it does not work. I also tried Ultimike's suggestion in #3, and it hides the errors, but does not resolve the issue.
Comment #12
benjy CreditAttribution: benjy commented@italiatina, can you expand on "does not work" in regards to the patch in #8? If you could post your drush output that would be great.
Comment #13
Tom Elwertowski CreditAttribution: Tom Elwertowski commentedUsing 8.0.0-beta7, I'm still getting the error described in #7.
Comment #14
mikeker CreditAttribution: mikeker commentedIf we're throwing a
MigrateSkipRowException
then we don't need theuse
forMigrateException
. #8 fixed my errors related to a hidden label field, the attached patch just removes the unneededuse
line.I'm happy to add tests, though I'm new to the migrate project and could use some direction. I assume tests would go into
MigrateFieldFormatterSettingsTest.php
, correct? Where/How does the D6 field info get built? Any pointers would be great. (And I may have completely missed the docs -- sorry, I'm rushing this evening...) Thanks.Comment #15
mikeker CreditAttribution: mikeker commentedCrap. Wrong patch.
Comment #23
alanburke CreditAttribution: alanburke commentedThe patch works, and allows the migrations to continue.
I'm unsure what the testbot is complaining about.
Will try to retest it once more
Comment #28
tim.plunkettTestbot is behaving as expected, because the issue was assigned to beta2
Comment #29
alanburke CreditAttribution: alanburke commentedThanks Tim!
Comment #32
mikeker CreditAttribution: mikeker as a volunteer commentedRerolled #15.
@tim.plunkett: Thanks for spotting the bogus Drupal version number... I learn something new each day in the issue queue! :)
Comment #33
joelpittetchx mentioned on #drupal-migrate this is postponed on #2487568: Process plugins should not be allowed to skip rows
Comment #34
KarenS CreditAttribution: KarenS commentedOne of the problems noted above comes when you have any fields that are hidden in any view mode. This specific problem can be fixed, I created a separate issue for that at https://www.drupal.org/node/2498291.
Comment #35
ghazlewood CreditAttribution: ghazlewood commentedI needed the patch in #32 to get my D6-8 migration to work, otherwise nodes,
taxonomy* and most of the jobs in the manifest were skipped. I realise this issue has been postponed but it solved the problem for me on a test migration. Cross referencing this with #2221779: [Meta] Manual Testing: Complete D6 > D8 migrations as the patch that got the migration to work.*Edited as obviously this patch has nothing to do with taxonomy and that is still not working in my migration
Comment #36
neclimdulFollowing the Great Migrate Migration. We've been using this patch internally for months and since there are no changes going to RTBC.
This has been good to go for 3 months and the other issue isn't moving so lets have it clean up this rather then blocking it.
Comment #37
neclimdulComment #38
benjy CreditAttribution: benjy commentedI think we should have some test coverage here.
Comment #39
neclimdultests
Comment #40
neclimdulsorry, real interdiff.
Comment #41
neclimdulself review:
Can we get coverage annotations on those tests?
Sure!
Comment #42
benjy CreditAttribution: benjy commentedGreat +1.
I feel like the MigrateSkipRowException needs a reason message to log, make it easier to diagnose why a row is skipped. Maybe a follow-up to discuss?
EDIT: Could we at least add the message to the exception constructor here?
Comment #45
svendecabooter* There was an error in the namespace of the test class - fixed now.
* MigrateSkipRowException does have a message parameter now - see #2522012: Remove broken idlist handling, replace with more robust exception handling
* A message has been set when MigrateSkipRowException is thrown.
Comment #46
mikeryanActually, looking closely at this issue, I think no change is necessary since #2559571: Handle MigrateException consistently during import went in. One point that is poorly understood is that MigrateSkipRowException is meant to indicate that a row is being intentionally skipped - that is, the row is logically considered not part of the source to be migrated (use this when it's difficult to represent the logic for exclusion directly in the source query) - MigrateException is the one to throw in error conditions, and as of #2559571: Handle MigrateException consistently during import that is properly caught and handled.