Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
$ ./vendor/bin/drush solr-gsc solr_search_server conf.zip $SOLR_VERSION
[error] TypeError: Argument 3 passed to Drupal\search_api\Utility\CommandHelper::__construct() must implement interface Symfony\Component\EventDispatcher\EventDispatcherInterface, string given, called in /home/travis/build/mkalkbrenner/drupal/modules/contrib/search_api/src/Commands/SearchApiCommands.php on line 34 in Drupal\search_api\Utility\CommandHelper->__construct() (line 88 of /home/travis/build/mkalkbrenner/drupal/modules/contrib/search_api/src/Utility/CommandHelper.php) #0 /home/travis/build/mkalkbrenner/drupal/modules/contrib/search_api/src/Commands/SearchApiCommands.php(34): Drupal\search_api\Utility\CommandHelper->__construct(Object(Drupal\Core\Entity\EntityTypeManager), Object(Drupal\Core\Extension\ModuleHandler), 'dt')
#1 /home/travis/build/mkalkbrenner/drupal/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\search_api\Commands\SearchApiCommands->__construct(Object(Drupal\Core\Entity\EntityTypeManager), Object(Drupal\Core\Extension\ModuleHandler))
#2 /home/travis/build/mkalkbrenner/drupal/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array, 'search_api.comm...')
#3 /home/travis/build/mkalkbrenner/drupal/core/lib/Drupal/Component/DependencyInjection/Container.php(487): Drupal\Component\DependencyInjection\Container->get('search_api.comm...', 1)
#4 /home/travis/build/mkalkbrenner/drupal/core/lib/Drupal/Component/DependencyInjection/Container.php(326): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#5 /home/travis/build/mkalkbrenner/drupal/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array, 'drush.command.s...')
#6 /home/travis/build/mkalkbrenner/drupal/vendor/drush/drush/src/Boot/DrupalBoot8.php(277): Drupal\Component\DependencyInjection\Container->get('drush.command.s...')
#7 /home/travis/build/mkalkbrenner/drupal/vendor/drush/drush/src/Boot/DrupalBoot8.php(243): Drush\Boot\DrupalBoot8->addDrupalModuleDrushCommands(Object(Drush\Boot\BootstrapManager))
#8 /home/travis/build/mkalkbrenner/drupal/vendor/drush/drush/src/Boot/BootstrapManager.php(293): Drush\Boot\DrupalBoot8->bootstrapDrupalFull(Object(Drush\Boot\BootstrapManager), NULL)
#9 /home/travis/build/mkalkbrenner/drupal/vendor/drush/drush/src/Boot/BootstrapManager.php(493): Drush\Boot\BootstrapManager->doBootstrap(5, 6, NULL)
#10 /home/travis/build/mkalkbrenner/drupal/vendor/drush/drush/src/Application.php(225): Drush\Boot\BootstrapManager->bootstrapMax()
#11 /home/travis/build/mkalkbrenner/drupal/vendor/drush/drush/src/Application.php(192): Drush\Application->bootstrapAndFind('solr-gsc')
#12 /home/travis/build/mkalkbrenner/drupal/vendor/symfony/console/Application.php(236): Drush\Application->find('solr-gsc')
#13 /home/travis/build/mkalkbrenner/drupal/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /home/travis/build/mkalkbrenner/drupal/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /home/travis/build/mkalkbrenner/drupal/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /home/travis/build/mkalkbrenner/drupal/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#17 /home/travis/build/mkalkbrenner/drupal/vendor/drush/drush/drush(4): require('/home/travis/bu...')
#18 {main}.
TypeError: Argument 3 passed to Drupal\search_api\Utility\CommandHelper::__construct() must implement interface Symfony\Component\EventDispatcher\EventDispatcherInterface, string given, called in /home/travis/build/mkalkbrenner/drupal/modules/contrib/search_api/src/Commands/SearchApiCommands.php on line 34 in Drupal\search_api\Utility\CommandHelper->__construct() (line 88 of /home/travis/build/mkalkbrenner/drupal/modules/contrib/search_api/src/Utility/CommandHelper.php).
Caused by the commit of #3023704: Convert hooks to events To search_api.
Comment | File | Size | Author |
---|---|---|---|
#6 | 3065359.patch | 1.87 KB | mkalkbrenner |
|
Comments
Comment #2
mkalkbrennerComment #3
mkalkbrennerComment #4
mkalkbrennerI moved the issue to Search API for awareness and since there's no search_api_solr code involved in the stack trace.
Comment #5
mkalkbrennerYes, here's the cause:
The third parameter of CommandHelper::_construct() changed.
Comment #6
mkalkbrennerComment #7
borisson_This is a simple fix, but I'm not sure how this got in. We should try to find a way to also test this on the d.o infra I guess.
Comment #8
waverate CreditAttribution: waverate commented@mkalkbrenner. Thank you for the fix. Works great.
Comment #9
drunken monkeyThanks a lot for finding and fixing this, Markus!
Cleaned up the code a bit and committed.
Thanks a lot again!
Yeah, I don’t really use Drush for Search API stuff, so it’s possible that even such critical bugs in the Drush integration can slip in. Also, I’m not aware of any way to test the Drush integration using d.o’s CI tools. We do test the
CommandHelper
class, which should cover most problems – but, as we see here, the tiny bit that does remain in the Drush-specific class can’t easily be covered and remains a risk.Comment #12
blake.thompson CreditAttribution: blake.thompson at Slalom commentedIf people happen upon this issue, this can break Search API Solr's use with Drush due to it extending the CommandHelper class, depending on which versions you have installed.