I stumbled upon this issue while testing a very simple D6->D8 node migration (https://drupal.org/node/2233883), and thanks to benjy, I was able to track it down enough to the point where we think it is an actual issue.
tl;dr;
The d6_cck_field_revision migration has a hard dependency on the d6_node_revision migration, but when there are no non-active (?) revisions in the source DB, the d6_node_migration doesn't have anything to migrate, so it fails checkRequirements().
Background
I started with a new D6 site, enabled CCK's "Content" and "Link" modules, then added a simple link field to the "story" content type. I added one "story" node and one "page" node.
I also created a fresh D8 site, enabled the migrate_drupal and link modules.
Initial test
I ran a node migration using the manifest from https://drupal.org/comment/8652693#comment-8652693.
~/Sites/imp $ drush migrate-manifest mysql://imp@localhost/drupal6 manifest.yml
Migration d6_cck_field_revision:page did not meet the requirements [error]
Migration d6_cck_field_revision:story did not meet the requirements
I then stepped through the code and found that the d6_node_revision migration wasn't passing checkRequirements and returning FALSE on
// If the dependent migration has not processed any record, it means the
// dependency requirements are not met.
if (!$required_migration->getIdMap()->processedCount()) {
return FALSE;
}
I checked my D8 database and saw that there were 2 node_revision records (one for each of my 2 nodes), but no records in the migrate_map_d6_node_revision table.
Theory
Clearly, revisions were being created, but not by the d6_node_revision migration. I'm thinking that the two revisions I see are the result of the d6_node migration, as these are the current revisions for my 2 nodes. This would explain why we have 2 revisions, but nothing in the migrate_map_d6_node_revision table.
Because the d6_cck_field_revision has a hard dependency on d6_node_revision, when it checksRequirements and fails, d6_cck_field_revision never runs.
Solution?
Perhaps the way to solve this is to have the d6_node migration add an id mapping for the revision it creates?
-mike
Comments
Comment #1
chx CreditAttribution: chx commentedAnd why is it a problem if d6_cck_field_revision doesn't run...? If there are no non-default revisions, it shouldn't.
Comment #2
ultimikechx,
I understand what you're saying. I think the issue is that it throws a PHP error...
-mike
Comment #3
chx CreditAttribution: chx commentedIs this the error you are referring to? If so, we can make d6_node_revision a soft dependency, I guess, with a comment.
Comment #4
chx CreditAttribution: chx commentedHrm, does drush stop on the first error immediately? If so then we need to change these to warnings, I guess?
Comment #5
ultimikeNo - drush doesn't stop on the first error - it finishes the migration.
In order to make it a soft dependency, do I just need to do something like this in the manifest?
- d6_cck_field_revision:*:false
-mike
Comment #6
chx CreditAttribution: chx commented> No - drush doesn't stop on the first error - it finishes the migration.
Then perhaps the error message could be improved simply?
Comment #7
ultimikeI actually think that making it a soft dependency would be a better solution - will the syntax I have in comment 5 work?
I just think that throwing an PHP error, regardless of if it is harmful or not, will freak people out.
-mike
Comment #8
benjy CreditAttribution: benjy commentedA soft dependency would look like this:
- d6_cck_field_revision: false
EDIT: O, I see it's a bundle migration, i'm not sure if the syntax would be the same. Maybe @chx can clarify?
Comment #9
ultimikeComment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedJust a side-track observation here:
After having built D6->D7 revision migrations I stepped back and thought: why do I have separate node and node_revisions migrations at all, when just the node_revisions would probably suffice?
I got to thinking about it because if running both, you actually need to skip the first item in the node_revisions table because the node migration had already taken care of it. It is possible there is a good reason not to do this... but it was a thought I had after everything was done and all the bugs were already fixed so I never bothered to attempt it.
Comment #11
chx CreditAttribution: chx commentedWe discussed this and similar in Austin and agreed to build a migrate status table and system similar to D7 and so the ran-but-nothing-happened wont be a problem any more. It'll allow us to depend on variable migrations too.
Comment #12
benjy CreditAttribution: benjy commentedWe changed how we track the result of a migration in #2314289: Track result of migrations and use it to properly define migrate_dependencies so this should no longer be an issue.
Closing, but please re-open if there is still a problem.