after execute migration from WordPress XML

Fatal error: Class 'Drush\Commands\DrushCommands' not found in /home/*****/modules/contrib/migrate_tools/src/Commands/MigrateToolsCommands.php on line 23

Drupal 8.8.0
PHP 7.1.33 / 7.2.25
migrate_tools 8.x-4.x-dev
wordpress_migrate 8.x-3.0-dev
Drush version 9.0-dev

Comments

proweb.ua created an issue. See original summary.

proweb.ua’s picture

Issue summary: View changes
proweb.ua’s picture

if PHP 7.0.33

ParseError: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in Composer\Autoload\includeFile() (line 28 of /home/***/***/***/modules/contrib/migrate_tools/src/Commands/MigrateToolsCommands.php) #0 /home/***/***/***/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/home/***/***...') #1 [internal function]: Composer\Autoload\ClassLoader->loadClass('Drupal\\migrate_...') #2 /home/***/***/***/modules/contrib/migrate_tools/src/MigrateTools.php(24): spl_autoload_call('Drupal\\migrate_...') #3 /home/***/***/***/modules/contrib/migrate_tools/src/MigrateExecutable.php(107): Drupal\migrate_tools\MigrateTools::buildIdList(Array) #4 /home/***/***/***/modules/contrib/migrate_tools/src/MigrateBatchExecutable.php(60): Drupal\migrate_tools\MigrateExecutable->__construct(Object(Drupal\migrate\Plugin\Migration), Object(Drupal\migrate\MigrateMessage), Array) #5 /home/***/***/***/modules/contrib/migrate_tools/src/Form/MigrationExecuteForm.php(203): Drupal\migrate_tools\MigrateBatchExecutable->__construct(Object(Drupal\migrate\Plugin\Migration), Object(Drupal\migrate\MigrateMessage), Array) #6 [internal function]: Drupal\migrate_tools\Form\MigrationExecuteForm->submitForm(Array, Object(Drupal\Core\Form\FormState)) #7 /home/***/***/***/core/lib/Drupal/Core/Form/FormSubmitter.php(112): call_user_func_array(Array, Array) #8 /home/***/***/***/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState)) #9 /home/***/***/***/core/lib/Drupal/Core/Form/FormBuilder.php(591): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState)) #10 /home/***/***/***/core/lib/Drupal/Core/Form/FormBuilder.php(320): Drupal\Core\Form\FormBuilder->processForm('migration_execu...', Array, Object(Drupal\Core\Form\FormState)) #11 /home/***/***/***/core/lib/Drupal/Core/Controller/FormController.php(91): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\migrate_tools\Form\MigrationExecuteForm), Object(Drupal\Core\Form\FormState)) #12 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) #13 /home/***/***/***/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #14 /home/***/***/***/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #15 /home/***/***/***/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #16 /home/***/***/***/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #17 /home/***/***/***/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #18 /home/***/***/***/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #19 /home/***/***/***/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /home/***/***/***/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /home/***/***/***/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /home/***/***/***/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /home/***/***/***/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /home/***/***/***/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /home/***/***/***/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /home/***/***/***/core/lib/Drupal/Core/DrupalKernel.php(694): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 /home/***/***/***/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #28 {main}.

arrubiu’s picture

Same problem: Drupal 8.8.0, PHP 7.3.12, migrate_tools 8.x-4.5

krishnamohan_ramadugula’s picture

Same problem,
When I try to execute the migration process for Joomla getting the following error.

Fatal error: Class 'Drush\Commands\DrushCommands' not found in [my drupal path]\modules\migrate_tools\src\Commands\MigrateToolsCommands.php on line 23

Details
PHP - 7.2.11
Drush - 9.7.1
Migrate tools - 8.x-4.5
Drupal core 8.8.0

heddn’s picture

Can't reproduce the issue. Using core 8.8.0 and drush 9.7.1 and tools 4.5. I used composer to require the dependencies. Is that how you did things?

philosurfer’s picture

I am having the same issue with the same versions but we are running Drush 8.3.1 and PHP 7.2.24

philosurfer’s picture

Noting, if I have a local drush in the /app/vendor/ folder installed this works.
If I am using a platform installed drush it fails with OP's error.

heddn’s picture

Category: Bug report » Support request
Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

Non local composer drush is not supported for drush 9. And the error in the OP is specifically for a version of migrate tools that only supports local composer installs of drush. Non local install of drush 8 and the legacy drush.inc commands is still available. Since I can't reproduce this, can I get an understanding if the common thread here is non local composer installed drush 9 causes this issue?

arrubiu’s picture

StatusFileSize
new1.79 KB

I've the problem only if I use the "sub_process" plugin for migrate.
The uploaded file works without the field_sezione" field, in process.
If I add it, it returns me the error (I've drush 8.x).

heddn’s picture

Drush 8 has best effort support at this point. Try updating to drush 10 or even 9. Does the issue go away?

philosurfer’s picture

Why would we be getting this issue in the UI where we are not calling Drush at all?

heddn’s picture

I guess I assumed the migration was executed from drush. But it sounds that might not be true. How are you executing the migration?

heddn’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new3.84 KB

That's gotta be the solution. Can someone report if this patch fixes things?

heddn’s picture

StatusFileSize
new315 bytes
new3.94 KB
proweb.ua’s picture

#15 works

philosurfer’s picture

Status: Needs review » Reviewed & tested by the community

#15 works. Thanks for the patch

  • heddn committed 65d06a1 on 8.x-4.x
    Issue #3099611 by heddn, arrubiu: Class 'Drush\Commands\DrushCommands'...

  • heddn committed 9c55c5e on 8.x-5.x
    Issue #3099611 by heddn, arrubiu: Class 'Drush\Commands\DrushCommands'...
heddn’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

edorsini@mit.edu’s picture

#15 worked for me. I'll add the patch to the composer.json.

heddn’s picture

This was committed and pushed 3 months ago.

damien laguerre’s picture

This issue is still present in the latest version 4.5.

The file in the last release still contains the problem:
https://git.drupalcode.org/project/migrate_tools/-/blob/8.x-4.5/src/Comm...

Line 28:

  /**
   * Default ID list delimiter.
   */
  public const DEFAULT_ID_LIST_DELIMITER = ':';

The file in the 8.x-4.x branch is Ok:
https://git.drupalcode.org/project/migrate_tools/-/blob/8.x-4.x/src/Comm...

I think you have to make a new release.

chalk’s picture

I agree with Damien. The dev version works.

  • Pantheon env
  • Drupal 8.8.5
  • migrate_tools 4.5 - error
  • migrate_tools 4.x dev - works fine
parthabapari’s picture

#24 worked for me. Thanks Damien.

b0gucki3’s picture

#15 works for me. Many thanks!

kenorb’s picture

FYI: Had this error with the latest version 6.0.2 due to the old dependency found in the custom module, the namespace is now called Drupal\migrate_tools\Drush\MigrateToolsCommands.

ddavisboxleitner’s picture

Regarding the file location change in migrate_tools, there is an issue with a patch that works in D10 here: https://www.drupal.org/project/path_redirect_import/issues/3373025