Upgrading 6.0.5 to 6.1.0 results in Drush error: ArgumentCountError: Too few arguments to function MigrateToolsCommands::__construct(), 4 passed in DependencyInjection/Container.php on line 259 and exactly 7 expected in MigrateToolsCommands->__construct()

Created on 8 July 2025, 4 days ago

Problem/Motivation

Upgrading from 6.0.5 to 6.1.0 on Drupal 10.1.x, Drush 11.6.0, results in the following error:

TypeError: Drupal\path_redirect_import\Drush\Commands\PathRedirectImportCommands::__construct(): Argument #5 ($time) must be of type Drupal\Component\Datetime\TimeInterface, Drupal\Core\File\FileSystem given, called in /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\path_redirect_import\Drush\Commands\PathRedirectImportCommands->__construct() (line 63 of modules/contrib/path_redirect_import/src/Drush/Commands/PathRedirectImportCommands.php).

Backtrace:

$ drush uli
 [error]  ArgumentCountError: Too few arguments to function Drupal\migrate_tools\Drush\Commands\MigrateToolsCommands::__construct(), 4 passed in /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 7 expected in Drupal\migrate_tools\Drush\Commands\MigrateToolsCommands->__construct() (line 48 of /app/web/modules/contrib/migrate_tools/src/Drush/Commands/MigrateToolsCommands.php) #0 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\migrate_tools\Drush\Commands\MigrateToolsCommands->__construct(Object(Drupal\migrate\Plugin\MigrationPluginManager), Object(Drupal\Core\Datetime\DateFormatter), Object(Drupal\Core\Entity\EntityTypeManager), Object(Drupal\Core\KeyValueStore\KeyValueFactory))
#1 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'migrate_tools.c...')
#2 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(440): Drupal\Component\DependencyInjection\Container->get('migrate_tools.c...', 3)
#3 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#4 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'drush.command.s...')
#5 /app/vendor/drush/drush/src/Boot/DrupalBoot8.php(306): Drupal\Component\DependencyInjection\Container->get('drush.command.s...')
#6 /app/vendor/drush/drush/src/Boot/DrupalBoot8.php(253): Drush\Boot\DrupalBoot8->addDrupalModuleDrushCommands(Object(Drush\Boot\BootstrapManager))
#7 /app/vendor/drush/drush/src/Boot/BootstrapManager.php(291): Drush\Boot\DrupalBoot8->bootstrapDrupalFull(Object(Drush\Boot\BootstrapManager), NULL)
#8 /app/vendor/drush/drush/src/Commands/core/LoginCommands.php(51): Drush\Boot\BootstrapManager->doBootstrap(5)
#9 [internal function]: Drush\Commands\core\LoginCommands->login('', Array)
#10 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array(Array, Array)
#11 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#12 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#13 /app/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(391): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#14 /app/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /app/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /app/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /app/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /app/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /app/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /app/vendor/drush/drush/drush.php(79): Drush\Runtime\Runtime->run(Array)
#21 /app/vendor/drush/drush/drush(4): require('/app/vendor/dru...')
#22 /app/vendor/bin/drush(120): include('/app/vendor/dru...')
#23 {main}.

Any suggestions on what I can do to work around this, apart from downgrading back to 6.0.5, please folks?

Thank you :)

/A

🐛 Bug report
Status

Active

Version

6.1

Component

Code

Created by

🇬🇧United Kingdom alexharries

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024