drupal-graphql / graphql

GraphQL integration for Drupal 9/10
288 stars 201 forks source link

Call to undefined method GuzzleHttp\Utils::chooseHandler() When updating to Drupal 10 (GraphQL version 3) #1390

Open rhd-developers opened 9 months ago

rhd-developers commented 9 months ago

I'm updating a Drupal site from 9 to 10 which is currently using version 3 of GraphQL. I'm not sure if this should be fully supported, but it says so on the Drupal module page, so I'm assuming so. I don't have time to upgrade to V4 yet as it seems quite a bit of work. Is there any workaround or fix for this error I'm receiving when trying to use Drush?

Fatal error: Uncaught Error: Call to undefined method GuzzleHttp\Utils::chooseHandler() in

This error usually points to a globally installed version of Drush, but this isn't the case. Version 4 installs and I can run drush fine, although my codebase breaks because of the update.

Full error:

Fatal error: Uncaught Error: Call to undefined method GuzzleHttp\Utils::chooseHandler() in /app/vendor/guzzlehttp/guzzle/src/HandlerStack.php:49
Stack trace:
#0 [internal function]: GuzzleHttp\HandlerStack::create()
#1 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(255): call_user_func_array(Array, Array)
#2 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'GuzzleHttp\\Hand...')
#3 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(440): Drupal\Component\DependencyInjection\Container->get('GuzzleHttp\\Hand...', 1)
#4 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#5 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'http_client_fac...')
#6 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(440): Drupal\Component\DependencyInjection\Container->get('http_client_fac...', 1)
#7 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(249): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#8 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'http_client')
#9 /app/web/modules/contrib/graphql/modules/graphql_core/src/Plugin/GraphQL/Fields/Routing/ExternalUrl/ExternalRequest.php(45): Drupal\Component\DependencyInjection\Container->get('http_client')
#10 /app/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(21): Drupal\graphql_core\Plugin\GraphQL\Fields\Routing\ExternalUrl\ExternalRequest::create(Object(Drupal\Core\DependencyInjection\Container), Array, 'external_url_re...', Array)
#11 /app/web/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(83): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('external_url_re...', Array)
#12 /app/web/modules/contrib/graphql/src/Plugin/FieldPluginManager.php(65): Drupal\Component\Plugin\PluginManagerBase->createInstance('external_url_re...')
#13 /app/web/modules/contrib/graphql/src/Plugin/Deriver/PluggableSchemaDeriver.php(367): Drupal\graphql\Plugin\FieldPluginManager->getInstance(Array)
#14 [internal function]: Drupal\graphql\Plugin\Deriver\PluggableSchemaDeriver->Drupal\graphql\Plugin\Deriver\{closure}(Array, 'external_url_re...')
#15 /app/web/modules/contrib/graphql/src/Plugin/Deriver/PluggableSchemaDeriver.php(365): array_reduce(Array, Object(Closure), Array)
#16 [internal function]: Drupal\graphql\Plugin\Deriver\PluggableSchemaDeriver->Drupal\graphql\Plugin\Deriver\{closure}(Array, Array)
#17 /app/web/modules/contrib/graphql/src/Plugin/Deriver/PluggableSchemaDeriver.php(364): array_reduce(Array, Object(Closure), Array)
#18 /app/web/modules/contrib/graphql/src/Plugin/Deriver/PluggableSchemaDeriver.php(104): Drupal\graphql\Plugin\Deriver\PluggableSchemaDeriver->buildFieldMap(Object(Drupal\graphql\Plugin\FieldPluginManager), Array)
#19 /app/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\graphql\Plugin\Deriver\PluggableSchemaDeriver->getDerivativeDefinitions(Array)
#20 /app/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array)
#21 /app/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(323): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#22 /app/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(205): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions()
#23 /app/web/modules/contrib/graphql/src/Routing/QueryRoutes.php(54): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#24 /app/web/core/lib/Drupal/Core/Routing/RouteSubscriberBase.php(37): Drupal\graphql\Routing\QueryRoutes->alterRoutes(Object(Symfony\Component\Routing\RouteCollection))
#25 [internal function]: Drupal\Core\Routing\RouteSubscriberBase->onAlterRoutes(Object(Drupal\Core\Routing\RouteBuildEvent), 'routing.route_a...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#26 /app/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Drupal\Core\Routing\RouteBuildEvent), 'routing.route_a...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#27 /app/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(189): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Drupal\Core\Routing\RouteBuildEvent), 'routing.route_a...')
#28 /app/web/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#29 /app/web/core/includes/common.inc(485): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#30 /app/web/core/includes/utility.inc(41): drupal_flush_all_caches(Object(Drupal\Core\DrupalKernel))
#31 /app/vendor/drush/drush/src/Commands/core/CacheRebuildCommands.php(66): drupal_rebuild(Object(Composer\Autoload\ClassLoader), Object(Symfony\Component\HttpFoundation\Request))
#32 [internal function]: Drush\Commands\core\CacheRebuildCommands->rebuild(Array)
#33 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array(Array, Array)
#34 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#35 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#36 /app/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#37 /app/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#38 /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))
#39 /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))
#40 /app/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#41 /app/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#42 /app/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#43 /app/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run(Array)
#44 /app/vendor/drush/drush/drush(4): require('/app/vendor/dru...')
#45 /app/vendor/bin/drush(120): include('/app/vendor/dru...')
#46 {main}
  thrown in /app/vendor/guzzlehttp/guzzle/src/HandlerStack.php on line 49
 [warning] Drush command terminated abnormally.