Bounty: 150
I’m trying to do a ‘file to media’ migration on a d8 installation. Following the readme on the module I have created a custom module and created the two yaml files. After enabling the module and drush ms
i get the following error:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed
The error appears on my local (DDEV) and my production environment. Drush works otherwise. drush sql-cli
works.
I think i’m missing something. Do i have to set a database reference somewhere?
Happy to provide additional information when needed, as i’m clueless atm.
Thanks for pointing me in the right direction.
Edit:
output of drush ms -v
Exception trace:
at myproject/docroot/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php:416
PDO->__construct() at myproject/docroot/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php:416
DrupalCoreDatabaseDrivermysqlConnection::open() at myproject/docroot/core/lib/Drupal/Core/Database/Database.php:374
DrupalCoreDatabaseDatabase::openConnection() at myproject/docroot/core/lib/Drupal/Core/Database/Database.php:169
DrupalCoreDatabaseDatabase::getConnection() at myproject/docroot/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php:201
DrupalmigratePluginmigratesourceSqlBase->setUpDatabase() at myproject/docroot/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php:154
DrupalmigratePluginmigratesourceSqlBase->getDatabase() at myproject/docroot/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php:221
DrupalmigratePluginmigratesourceSqlBase->checkRequirements() at myproject/docroot/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php:112
Drupalmigrate_drupalPluginmigratesourceDrupalSqlBase->checkRequirements() at myproject/docroot/modules/contrib/metatag/src/Plugin/migrate/source/d7/MetatagFieldInstanceDeriver.php:69
DrupalmetatagPluginmigratesourced7MetatagFieldInstanceDeriver->getDerivativeDefinitions() at myproject/docroot/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php:101
DrupalComponentPluginDiscoveryDerivativeDiscoveryDecorator->getDerivatives() at myproject/docroot/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php:87
DrupalComponentPluginDiscoveryDerivativeDiscoveryDecorator->getDefinitions() at myproject/docroot/core/modules/migrate/src/Plugin/MigrationPluginManager.php:262
DrupalmigratePluginMigrationPluginManager->findDefinitions() at myproject/docroot/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php:175
DrupalCorePluginDefaultPluginManager->getDefinitions() at myproject/docroot/core/modules/migrate/src/Plugin/MigrationPluginManager.php:109
DrupalmigratePluginMigrationPluginManager->createInstances() at myproject/docroot/modules/contrib/migrate_tools/src/Commands/MigrateToolsCommands.php:697
Drupalmigrate_toolsCommandsMigrateToolsCommands->migrationsList() at myproject/docroot/modules/contrib/migrate_tools/src/Commands/MigrateToolsCommands.php:135
Drupalmigrate_toolsCommandsMigrateToolsCommands->status() at n/a:n/a
call_user_func_array() at myproject/vendor/consolidation/annotated-command/src/CommandProcessor.php:257
ConsolidationAnnotatedCommandCommandProcessor->runCommandCallback() at myproject/vendor/consolidation/annotated-command/src/CommandProcessor.php:212
ConsolidationAnnotatedCommandCommandProcessor->validateRunAndAlter() at myproject/vendor/consolidation/annotated-command/src/CommandProcessor.php:176
ConsolidationAnnotatedCommandCommandProcessor->process() at myproject/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:302
ConsolidationAnnotatedCommandAnnotatedCommand->execute() at myproject/vendor/symfony/console/Command/Command.php:255
SymfonyComponentConsoleCommandCommand->run() at myproject/vendor/symfony/console/Application.php:1005
SymfonyComponentConsoleApplication->doRunCommand() at myproject/vendor/symfony/console/Application.php:255
SymfonyComponentConsoleApplication->doRun() at myproject/vendor/symfony/console/Application.php:148
SymfonyComponentConsoleApplication->run() at myproject/vendor/drush/drush/src/Runtime/Runtime.php:118
DrushRuntimeRuntime->doRun() at myproject/vendor/drush/drush/src/Runtime/Runtime.php:49
DrushRuntimeRuntime->run() at myproject/vendor/drush/drush/drush.php:72
require() at myproject/vendor/drush/drush/includes/preflight.inc:18
drush_main() at phar:///usr/local/bin/drush/bin/drush.php:143
require() at /usr/local/bin/drush:10