"drush dmu-upgrade MODULE_NAME" give me 2 errors:

Argument 2 passed to Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions\EntityOperationDeriver::__construct() must be of the   [error]
type array, null given, called in
/var/www/html/drupal/modules/drupal/moduleupgrader/src/Plugin/DMU/Converter/Functions/EntityOperationDeriver.php on line 32 and
defined EntityOperationDeriver.php:20
Drush command terminated abnormally due to an unrecoverable error.                                                                     [error]

Comments

CZ created an issue. See original summary.

HongPong’s picture

Status: Active » Postponed (maintainer needs more info)

If possible can you provide the stack trace in something like a github gist? Without reference to the original code this was attempted on, it can't be reproduced. If there is more information available please re-open the issue.

solide-echt’s picture

I'm not sure how to provide the full stack trace but here's additional info:

  • trying to upgrade the module field_comments 7.x-1.1
  • more detailed error log:
    TypeError: Argument 2 passed to Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FunctionCallDeriver::__construct() must be of the type array, null given, called in /Users/Shared/htdocs/drupal8/web/sites/nwmo.test/modules/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/FunctionCallDeriver.php on line 27 in Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FunctionCallDeriver->__construct() (line 16 of /Users/Shared/htdocs/drupal8/web/sites/nwmo.test/modules/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/FunctionCallDeriver.php) #0 /Users/Shared/htdocs/drupal8/web/sites/nwmo.test/modules/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/FunctionCallDeriver.php(27): Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FunctionCallDeriver->__construct(Object(Drupal\Core\StringTranslation\TranslationManager), NULL) #1 /Users/Shared/htdocs/drupal8/web/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php(20): Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FunctionCallDeriver::create(Object(Drupal\Core\DependencyInjection\Container), '_function_call') #2 /Users/Shared/htdocs/drupal8/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(99): Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator->getDeriver('_function_call', Array) #3 /Users/Shared/htdocs/drupal8/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array) #4 /Users/Shared/htdocs/drupal8/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(283): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() #5 /Users/Shared/htdocs/drupal8/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(174): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() #6 /Users/Shared/htdocs/drupal8/web/sites/nwmo.test/modules/drupalmoduleupgrader/drupalmoduleupgrader.drush.inc(108): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() #7 /Users/Shared/htdocs/drupal8/web/sites/nwmo.test/modules/drupalmoduleupgrader/drupalmoduleupgrader.drush.inc(249): _dmu_plugin_list('analyzer') #8 /Users/Shared/htdocs/drupal8/vendor/drush/drush/includes/command.inc(422): drush_drupalmoduleupgrader_dmu_analyze('field_comments') #9 /Users/Shared/htdocs/drupal8/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array) #10 /Users/Shared/htdocs/drupal8/vendor/drush/drush/includes/command.inc(199): drush_command('field_comments') #11 /Users/Shared/htdocs/drupal8/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array) #12 /Users/Shared/htdocs/drupal8/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch() #13 /Users/Shared/htdocs/drupal8/vendor/drush/drush/drush.php(12): drush_main() #14 {main}
    

Upon further inspection (dump($container->get('config.factory')->get('drupalmoduleupgrader.functions')) I noticed the definitions key (line 1013 in ImmutableConfig) is indeed null (#definitions: null). I am, however, at a complete loss how to interpret this...

HongPong’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks for filling this in - maybe it is possible to run a few of the upgrader functions instead of the full suite? Would you say this happens right away, or after some of it is processed?

plach’s picture

I experienced this after messing with the Conflig Split module and accidentally deleting all the DMU configuration. Reinstalling DMU properly allowed me to get rid of the error.

ugintl’s picture

I am getting this error while trying to upgrade a D7 module. Drupal 8.9, drush 9 and drupalmoduleupgrader latest dev version. I have searched a lot. In fact this is the 3rd day I am trying to solve this problem. I have also tried drush 10 and different version of the module. If someone can try upgrading and see if you get the same result. I am trying to upgrade https://www.drupal.org/project/menu_editor

If everything goes well on your side, I would appreciate if you can send me the upgraded module.

drush dmu-upgrade menu_editor
Indexing...
done.
 [error]  TypeError: Argument 2 passed to Psr\Log\AbstractLogger::warning() must be of the type array, string given, called in C:\laragon\www\sector\web\modules\contrib\drupalmoduleupgrader\src\Commands\DrupalmoduleupgraderCommands.php on line 191 in Psr\Log\AbstractLogger->warning() (line 83 of C:\laragon\www\sector\vendor\psr\log\Psr\Log\AbstractLogger.php) #0 C:\laragon\www\sector\web\modules\contrib\drupalmoduleupgrader\src\Commands\DrupalmoduleupgraderCommands.php(191): Psr\Log\AbstractLogger->warning('{target}_{hook}...', 'error')
#1 [internal function]: Drupal\drupalmoduleupgrader\Commands\DrupalmoduleupgraderCommands->upgrade('menu_editor', Array)
#2 C:\laragon\www\sector\vendor\consolidation\annotated-command\src\CommandProcessor.php(257): call_user_func_array(Array, Array)
#3 C:\laragon\www\sector\vendor\consolidation\annotated-command\src\CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#4 C:\laragon\www\sector\vendor\consolidation\annotated-command\src\CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#5 C:\laragon\www\sector\vendor\consolidation\annotated-command\src\AnnotatedCommand.php(311): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#6 C:\laragon\www\sector\vendor\symfony\console\Command\Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 C:\laragon\www\sector\vendor\symfony\console\Application.php(1027): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 C:\laragon\www\sector\vendor\symfony\console\Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 C:\laragon\www\sector\vendor\symfony\console\Application.php(149): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 C:\laragon\www\sector\vendor\drush\drush\src\Runtime\Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 C:\laragon\www\sector\vendor\drush\drush\src\Runtime\Runtime.php(48): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 C:\laragon\www\sector\vendor\drush\drush\drush.php(72): Drush\Runtime\Runtime->run(Array)
#13 C:\laragon\www\sector\vendor\drush\drush\drush(4): require('C:\\laragon\\www\\...')
#14 {main}.
TypeError: Argument 2 passed to Psr\Log\AbstractLogger::warning() must be of the type array, string given, called in C:\laragon\www\sector\web\modules\contrib\drupalmoduleupgrader\src\Commands\DrupalmoduleupgraderCommands.php on line 191 in Psr\Log\AbstractLogger->warning() (line 83 of C:\laragon\www\sector\vendor\psr\log\Psr\Log\AbstractLogger.php).
 [warning] Drush command terminated abnormally.
joseph.olstad’s picture

Status: Fixed » Closed (fixed)

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