Problem/Motivation
"Failed to connect to your database server"
Steps to reproduce
Create migration group using UI. After final step, classic Drupal database connection error alert:
"Failed to connect to your database server. The server reports the following message: No database connection configured for source plugin variable.
Is the database server running?
Does the database exist, and have you entered the correct database name?
Have you entered the correct username and password?
Have you entered the correct database hostname?"
Log:
Warning: Undefined array key "migration" in Drupal\migrate\Plugin\Migration->findMigrationDependencies() (line 641 of /usr/local/www/apache24/data/newcognosce/web/core/modules/migrate/src/Plugin/Migration.php)
#0 /usr/local/www/apache24/data/newcognosce/web/core/includes/bootstrap.inc(305): _drupal_error_handler_real(2, 'Undefined array...', '/usr/local/www/...', 641)
#1 /usr/local/www/apache24/data/newcognosce/web/core/modules/migrate/src/Plugin/Migration.php(641): _drupal_error_handler(2, 'Undefined array...', '/usr/local/www/...', 641)
#2 /usr/local/www/apache24/data/newcognosce/web/core/modules/migrate/src/Plugin/Migration.php(614): Drupal\migrate\Plugin\Migration->findMigrationDependencies(Array)
#3 /usr/local/www/apache24/data/newcognosce/web/modules/wordpress_migrate/src/WordPressMigrationGenerator.php(327): Drupal\migrate\Plugin\Migration->getMigrationDependencies()
#4 /usr/local/www/apache24/data/newcognosce/web/modules/wordpress_migrate/src/WordPressMigrationGenerator.php(252): Drupal\wordpress_migrate\WordPressMigrationGenerator::createEntityFromPlugin('wordpress_comme...', 'my_wordpress_co...')
#5 /usr/local/www/apache24/data/newcognosce/web/modules/wordpress_migrate/src/WordPressMigrationGenerator.php(176): Drupal\wordpress_migrate\WordPressMigrationGenerator->createContentMigration('post')
In fact, database is running and site is otherwise behaving normally.
Something looks awry in the handoff from getMigrationDependencies to findMigrationDependencies during processing of comments.
Update: see #3390754: Undefined array key "migration" in findMigrationDependencies()
Comments
Comment #2
robballan commentedAppears to be fixed (at least, allows finished execution of migration group wizard) with the following change to (of all things) the settings.php file [from https://drupal.stackexchange.com/questions/227724/how-to-resolve-my-data...
$databases['migrate']['default'] = array (
'database' => 'NAME',
'username' => 'USER',
'password' => 'PASS',
'prefix' => '',
'host' => 'localhost',
'port' => '3306',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
);
Also, must be sure to install phpxx-xmlreader and phpxx-xmlwriter.
Comment #4
hongpong commentedThanks I am adding this to the readme. The Undefined array key "migration" issue is probably separate from the database drop. See #3220304: The "migration" plugin does not exist. (on Drupal 9)
Comment #6
djassie commentedGot this warning message - during - writing custom migration
id: custom_migration
label: Custom Migration
but label should be quoted, like `label: 'Custom Migration'
Comment #7
hongpong commentedHello @djassie,
I have posted a new version alpha6 with ctools v4 and migrate_plus v6
, can you give that a try? If the issue recurs please file a new issue.UPDATE: It is still happening I opened #3390754: Undefined array key "migration" in findMigrationDependencies().
Comment #8
hongpong commented