Error on drush cc

Created on 7 October 2024, 3 months ago
 [error]  ArgumentCountError: Too few arguments to function Drupal\tfa\Commands\TfaCommands::__construct(), 1 passed in /var/core/www/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 2 expected in Drupal\tfa\Commands\TfaCommands->__construct() (line 38 of /var/core/www/modules/contrib/tfa/src/Commands/TfaCommands.php) #0 /var/core/www/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\tfa\Commands\TfaCommands->__construct()
#1 /var/core/www/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
#2 /var/core/www/core/lib/Drupal/Component/DependencyInjection/Container.php(440): Drupal\Component\DependencyInjection\Container->get()
#3 /var/core/www/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
#4 /var/core/www/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
#5 /var/core/vendor/drush/drush/src/Boot/DrupalBoot8.php(306): Drupal\Component\DependencyInjection\Container->get()
#6 /var/core/vendor/drush/drush/src/Boot/DrupalBoot8.php(253): Drush\Boot\DrupalBoot8->addDrupalModuleDrushCommands()
#7 /var/core/vendor/drush/drush/src/Boot/BootstrapManager.php(291): Drush\Boot\DrupalBoot8->bootstrapDrupalFull()
#8 /var/core/vendor/drush/drush/src/Boot/BootstrapManager.php(477): Drush\Boot\BootstrapManager->doBootstrap()
#9 /var/core/vendor/drush/drush/src/Boot/BootstrapManager.php(412): Drush\Boot\BootstrapManager->bootstrapMax()
#10 /var/core/vendor/drush/drush/src/Boot/BootstrapManager.php(384): Drush\Boot\BootstrapManager->bootstrapToPhaseIndex()
#11 /var/core/vendor/drush/drush/src/Boot/BootstrapHook.php(32): Drush\Boot\BootstrapManager->bootstrapToPhase()
#12 /var/core/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php(44): Drush\Boot\BootstrapHook->initialize()
#13 /var/core/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php(36): Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->doInitializeHook()
#14 /var/core/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php(29): Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook()
#15 /var/core/vendor/consolidation/annotated-command/src/CommandProcessor.php(145): Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize()
#16 /var/core/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(376): Consolidation\AnnotatedCommand\CommandProcessor->initializeHook()
#17 /var/core/vendor/symfony/console/Command/Command.php(292): Consolidation\AnnotatedCommand\AnnotatedCommand->initialize()
#18 /var/core/vendor/symfony/console/Application.php(1081): Symfony\Component\Console\Command\Command->run()
#19 /var/core/vendor/symfony/console/Application.php(320): Symfony\Component\Console\Application->doRunCommand()
#20 /var/core/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun()
#21 /var/core/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
#22 /var/core/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
#23 /var/core/vendor/drush/drush/drush.php(79): Drush\Runtime\Runtime->run()
#24 /var/core/vendor/drush/drush/drush(4): require('...')
#25 /var/core/vendor/bin/drush(119): include('...')
#26 {main}.
🐛 Bug report
Status

Active

Version

1.8

Component

Code

Created by

🇬🇧United Kingdom olekstkach Liverpool

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

Comments & Activities

  • Issue created by @olekstkach
  • 🇬🇧United Kingdom olekstkach Liverpool
  • 🇧🇷Brazil dungahk Balneário Camboriú

    Hi,

    This report is for the TFA module, not the diff module.

  • 🇧🇷Brazil dungahk Balneário Camboriú
  • 🇧🇷Brazil dungahk Balneário Camboriú
  • 🇺🇸United States cmlara

    Can you advise what version of Drupal Core and Drush are involved (as well as confirm the TFA version? I am trying to determine how high I need to prioritize this issue.

    I see we have not updated the Drush commands to use the create() method. There is work that has to be done here however even with Drush 13.3 I am not able to reproduce the error.

    This could possibly be an update from 1.6 issue as the extra service was added in 1.7. Drush sometimes is unable to fully purge its caches requiring using core/rebuild.php, although I'm not sure if that would resolve this with the service in the Drush container.

    The only other scenario I can think of for why I can not reproduce this is that the Drush developers have reported in the past if the cache is cleared via the UI the drush.services.yml will not be reloaded which might cause this.

    All that is an aside as to be "future proof" we would want to use create() for the tfa.commands service as drush.service.yml was suppose to be removed in 13.0. https://www.drush.org/11.x/dependency-injection/#create-method

    For tfa.token_managerI'm on the fence, This service is only useful to Drush, I would prefer not to pollute the Global container, though equally avoiding doing so may be excessively complex. The primary reason for the service existence is unit testing.

    As an aside to help your contributions gain acceptance on TFA and other projects:
    Drupal.Org has dropped the ability to work with patch files. Contributions need to use MR's going forward to be tested. More details can be found at https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-dr...

Production build 0.71.5 2024