drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
https://www.drush.org
2.34k stars 1.08k forks source link

Drush command terminated abnormally on migrate-upgrade (D6 to D8) #4285

Closed NiklasBr closed 4 years ago

NiklasBr commented 4 years ago

Describe the bug When running the below command, migration stops on fatal error on/after Upgrading search_page:

drush migrate-upgrade --legacy-db-key="legacy" --legacy-root=/usr/share/nginx/html --legacy-db-prefix=sjoskogen_ --legacy-root=/usr/share/nginx/html

To Reproduce A Drupal source site, version 6.52 (LTS) to migrate to Drupal target 8.8.0

Relevant part of composer.json (I hope), Drupal 8 installed yesterday following this guide

    "require": {
        "composer/installers": "^1.2",
        "drupal/captcha": "^1.0@beta",
        "drupal/core-composer-scaffold": "^8.8",
        "drupal/core-project-message": "^8.8",
        "drupal/core-recommended": "^8.8",
        "drupal/devel": "^2.1",
        "drupal/google_analytics": "^3.0",
        "drupal/migrate_plus": "^5.0",
        "drupal/migrate_tools": "^5.0",
        "drupal/migrate_upgrade": "^3.1",
        "drupal/pathauto": "^1.6",
        "drupal/semanticviews": "^2.2",
        "drupal/simple_reservation": "*",
        "drupal/smtp": "^1.0@beta",
        "drush/drush": "^9.0"
    },

On the D6 site the following non-core modules are installed and active (and also the core search module is installed and active)

SELECT filename FROM `sjoskogen_system` WHERE status = 1 AND type = "module" AND (filename LIKE "sites/all%" OR filename LIKE "%search%")
modules/search/search.module
sites/all/modules/captcha/captcha.module
sites/all/modules/captcha/image_captcha/image_captcha.module
sites/all/modules/cck/content.module
sites/all/modules/cck/modules/optionwidgets/optionwidgets.module
sites/all/modules/cck/modules/text/text.module
sites/all/modules/cck/modules/userreference/userreference.module
sites/all/modules/colorbox/colorbox.module
sites/all/modules/date/date/date.module
sites/all/modules/date/date_api.module
sites/all/modules/date/date_popup/date_popup.module
sites/all/modules/date/date_timezone/date_timezone.module
sites/all/modules/filefield/filefield.module
sites/all/modules/google_analytics/googleanalytics.module
sites/all/modules/imageapi/imageapi.module
sites/all/modules/imageapi/imageapi_gd.module
sites/all/modules/imageapi/imageapi_imagemagick.module
sites/all/modules/imagecache/imagecache.module
sites/all/modules/imagecache/imagecache_ui.module
sites/all/modules/imagefield/imagefield.module
sites/all/modules/jquery_ui/jquery_ui.module
sites/all/modules/mydropwizard/mydropwizard.module
sites/all/modules/semanticviews/semanticviews.module
sites/all/modules/simple_reservation/simplereservation.module
sites/all/modules/smtp/smtp.module
sites/all/modules/transliteration/transliteration.module
sites/all/modules/views/views_ui.module
sites/all/modules/wysiwyg/wysiwyg.module
sites/all/modules/pathauto/pathauto.module
sites/all/modules/taxonomy_defaults/taxonomy_defaults.module
sites/all/modules/cck/modules/fieldgroup/fieldgroup.module
sites/all/modules/taxonomy_access/taxonomy_access.module
sites/all/modules/token/token.module
sites/all/modules/views/views.module
sites/all/modules/jquery_update/jquery_update.module
sites/all/modules/vertical_tabs/vertical_tabs.module

On the D8 site I enable the following modules after doing a standard installation profile:

drush pm:enable migrate_drupal_ui smtp simplereservation migrate_plus migrate_tools google_analytics update syslog migrate_drupal migrate media forum entity_reference captcha migrate_upgrade telephone pathauto semanticviews

Expected behavior Even if not all data can be migrated due to lack of support in target modules I think the fatal error is unwanted.

Actual behavior

Upgrading contact_category
Upgrading d6_date_formats
Upgrading d6_dblog_settings
Upgrading d6_filter_format
 [error]  Missing filter plugin: filter_null. 
Upgrading d6_imagecache_presets
Upgrading d6_language_content_menu_settings
Upgrading d6_language_types
Upgrading d6_search_settings
Upgrading d6_syslog_settings
Upgrading d6_system_cron
Upgrading d6_system_date
Upgrading d6_system_file
Upgrading d6_system_performance
Upgrading d6_url_alias
Upgrading d6_user_mail
Upgrading d6_user_settings
Upgrading file_settings
Upgrading locale_settings
Upgrading menu_settings
Upgrading search_page
 [error]  TypeError: Argument 1 passed to Drupal\search\Plugin\ConfigurableSearchPluginBase::setConfiguration() must be of the type array, null given, called in /usr/share/nginx/sjoskogen8/web/core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php on line 106 in Drupal\search\Plugin\ConfigurableSearchPluginBase->setConfiguration() (line 46 of /usr/share/nginx/sjoskogen8/web/core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php) #0 /usr/share/nginx/sjoskogen8/web/core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php(106): Drupal\search\Plugin\ConfigurableSearchPluginBase->setConfiguration(NULL)
#1 /usr/share/nginx/sjoskogen8/web/core/modules/migrate/src/Plugin/migrate/destination/Entity.php(164): Drupal\search\Plugin\migrate\destination\EntitySearchPage->updateEntity(Object(Drupal\search\Entity\SearchPage), Object(Drupal\migrate\Row))
#2 /usr/share/nginx/sjoskogen8/web/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php(140): Drupal\migrate\Plugin\migrate\destination\Entity->getEntity(Object(Drupal\migrate\Row), Array)
#3 /usr/share/nginx/sjoskogen8/web/core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php(86): Drupal\migrate\Plugin\migrate\destination\EntityConfigBase->import(Object(Drupal\migrate\Row), Array)
#4 /usr/share/nginx/sjoskogen8/web/core/modules/migrate/src/MigrateExecutable.php(226): Drupal\search\Plugin\migrate\destination\EntitySearchPage->import(Object(Drupal\migrate\Row), Array)
#5 /usr/share/nginx/sjoskogen8/vendor/drush/drush/includes/drush.inc(223): Drupal\migrate\MigrateExecutable->import()
#6 /usr/share/nginx/sjoskogen8/vendor/drush/drush/includes/drush.inc(214): drush_call_user_func_array(Array, Array)
#7 /usr/share/nginx/sjoskogen8/web/modules/contrib/migrate_upgrade/src/MigrateUpgradeDrushRunner.php(266): drush_op(Array)
#8 /usr/share/nginx/sjoskogen8/web/modules/contrib/migrate_upgrade/src/Commands/MigrateUpgradeCommands.php(64): Drupal\migrate_upgrade\MigrateUpgradeDrushRunner->import()
#9 [internal function]: Drupal\migrate_upgrade\Commands\MigrateUpgradeCommands->upgrade(Array)
#10 /usr/share/nginx/sjoskogen8/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#11 /usr/share/nginx/sjoskogen8/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#12 /usr/share/nginx/sjoskogen8/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#13 /usr/share/nginx/sjoskogen8/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(302): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#14 /usr/share/nginx/sjoskogen8/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /usr/share/nginx/sjoskogen8/vendor/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /usr/share/nginx/sjoskogen8/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /usr/share/nginx/sjoskogen8/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /usr/share/nginx/sjoskogen8/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /usr/share/nginx/sjoskogen8/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /usr/share/nginx/sjoskogen8/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#21 /usr/share/nginx/sjoskogen8/vendor/drush/drush/includes/preflight.inc(18): require('/usr/share/ngin...')
#22 phar:///usr/bin/drush/bin/drush.php(141): drush_main()
#23 /usr/bin/drush(10): require('phar:///usr/bin...')
#24 {main}. 
TypeError: Argument 1 passed to Drupal\search\Plugin\ConfigurableSearchPluginBase::setConfiguration() must be of the type array, null given, called in /usr/share/nginx/sjoskogen8/web/core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php on line 106 in /usr/share/nginx/sjoskogen8/web/core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php on line 46 #0 /usr/share/nginx/sjoskogen8/web/core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php(106): Drupal\search\Plugin\ConfigurableSearchPluginBase->setConfiguration(NULL)
#1 /usr/share/nginx/sjoskogen8/web/core/modules/migrate/src/Plugin/migrate/destination/Entity.php(164): Drupal\search\Plugin\migrate\destination\EntitySearchPage->updateEntity(Object(Drupal\search\Entity\SearchPage), Object(Drupal\migrate\Row))
#2 /usr/share/nginx/sjoskogen8/web/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php(140): Drupal\migrate\Plugin\migrate\destination\Entity->getEntity(Object(Drupal\migrate\Row), Array)
#3 /usr/share/nginx/sjoskogen8/web/core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php(86): Drupal\migrate\Plugin\migrate\destination\EntityConfigBase->import(Object(Drupal\migrate\Row), Array)
#4 /usr/share/nginx/sjoskogen8/web/core/modules/migrate/src/MigrateExecutable.php(226): Drupal\search\Plugin\migrate\destination\EntitySearchPage->import(Object(Drupal\migrate\Row), Array)
#5 /usr/share/nginx/sjoskogen8/vendor/drush/drush/includes/drush.inc(223): Drupal\migrate\MigrateExecutable->import()
#6 /usr/share/nginx/sjoskogen8/vendor/drush/drush/includes/drush.inc(214): drush_call_user_func_array(Array, Array)
#7 /usr/share/nginx/sjoskogen8/web/modules/contrib/migrate_upgrade/src/MigrateUpgradeDrushRunner.php(266): drush_op(Array)
#8 /usr/share/nginx/sjoskogen8/web/modules/contrib/migrate_upgrade/src/Commands/MigrateUpgradeCommands.php(64): Drupal\migrate_upgrade\MigrateUpgradeDrushRunner->import()
#9 [internal function]: Drupal\migrate_upgrade\Commands\MigrateUpgradeCommands->upgrade(Array)
#10 /usr/share/nginx/sjoskogen8/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#11 /usr/share/nginx/sjoskogen8/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#12 /usr/share/nginx/sjoskogen8/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#13 /usr/share/nginx/sjoskogen8/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(302): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#14 /usr/share/nginx/sjoskogen8/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /usr/share/nginx/sjoskogen8/vendor/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /usr/share/nginx/sjoskogen8/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /usr/share/nginx/sjoskogen8/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /usr/share/nginx/sjoskogen8/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /usr/share/nginx/sjoskogen8/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /usr/share/nginx/sjoskogen8/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#21 /usr/share/nginx/sjoskogen8/vendor/drush/drush/includes/preflight.inc(18): require('/usr/share/ngin...')
#22 phar:///usr/bin/drush/bin/drush.php(141): drush_main()
#23 /usr/bin/drush(10): require('phar:///usr/bin...')
#24 {main}
TypeError: Argument 1 passed to Drupal\search\Plugin\ConfigurableSearchPluginBase::setConfiguration() must be of the type array, null given, called in /usr/share/nginx/sjoskogen8/web/core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php on line 106 in Drupal\search\Plugin\ConfigurableSearchPluginBase->setConfiguration() (line 46 of /usr/share/nginx/sjoskogen8/web/core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php).
 [warning] Drush command terminated abnormally. Check for an exit() in your Drupal site.

Workaround Is there another way to do the desired action?

System Configuration

Q A
Drush version? 9.7.1 (Drush Launcher Version: 0.6.0)
Drupal version? 8.8.0
PHP version 7.3.12
OS? Ubuntu 18.04.3

Additional information I downgraded to Drush 9 because Drush 10 was not fully compatible with Migrate Upgrade.

weitzman commented 4 years ago

Are you sure the this is a drush issue? Looks like migrate to me.

NiklasBr commented 4 years ago

No, I'm not entirely sure what the source of the issue is. I just know two things regarding the context of why I opted to report it here:

  1. When I tried to do the same thing using Migrate UI it did not show those errors but died/stopped when it reached filter_null so Drush must make some things differently and maybe this is one of those things?
  2. I have been trying to migrate since Drupal version 8.0 and still haven't succeeded, it is frustrating :)
quietone1 commented 4 years ago

Yes, this is a migrate issue. I suggest asking on #migrate in Slack or making a Drupal issue, with component 'migration system'.