0

I am getting GuzzleHttp errors when activating or trying to access a couple plugins in conjunction wit CiviCRM. This seems to be with newer versions of CiviCRM (5.52 & higher). I thought initially it was related to the ScormCloud plugin but then it came up with the google analytics plugin. Below are the errors.

Fatal error: Uncaught Error: Call to undefined method GuzzleHttp\Utils::chooseHandler() in /home/<<account>>/public_html/wp-content/plugins/scormcloud/vendor/guzzlehttp/guzzle/src/functions.php:61 
Stack trace: 
#0 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/HandlerStack.php(42): GuzzleHttp\choose_handler() 
#1 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Client.php(65): GuzzleHttp\HandlerStack::create() 
#2 /home/<<account>>/public_html/wp-content/plugins/scormcloud/vendor/rustici-software/scormcloud-api-v2-client-php/src/Api/CourseApi.php(77): GuzzleHttp\Client->__construct() 
#3 /home/<<account>>/public_html/wp-content/plugins/scormcloud/SCORMCloud_PHPLibrary/ScormEngineService2.php(63): RusticiSoftware\Cloud\V2\Api\CourseApi->__construct(NULL, Object(RusticiSoftware\Cloud\V2\Configuration), NULL) 
#4 /home/<<account>>/public_html/wp-content/plugins/scormcloud/scormcloudplugin.php(106): ScormEngineService->__construct('https://cloud.s...', 'YJC8NJPV9J', 'Rl in /home/<<account>>/public_html/wp-content/plugins/scormcloud/vendor/guzzlehttp/guzzle/src/functions.php on line 61


An error of type E_ERROR was caused in line 61 of the file /home/<<account>>/public_html/wp-content/plugins/googleanalytics/lib/analytics-admin/vendor/guzzlehttp/guzzle/src/functions.php. Error message: Uncaught Error: Call to undefined method GuzzleHttp\Utils::chooseHandler() in /home/<<account>>/public_html/wp-content/plugins/googleanalytics/lib/analytics-admin/vendor/guzzlehttp/guzzle/src/functions.php:61
Stack trace:
#0 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/HandlerStack.php(42): GuzzleHttp\choose_handler()
#1 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/vendor/guzzlehttp/guzzle/src/Client.php(65): GuzzleHttp\HandlerStack::create()
#2 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php(52): GuzzleHttp\Client->__construct()
#3 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php(252): CRM_Extension_Browser->getGuzzleClient()
#4 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php(196): CRM_Extension_Browser->grabRemoteJson()
#5 /home/<<account>>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Extension/Browser.php(151): CRM_Extension_Browser->_discoverRemot

1 Answer 1

2

They are probably using guzzle7. Civi will work with guzzle7 but ships with 6, so you need to manually go into the civicrm folder (the one that has e.g. a CRM folder, a Civi folder, a vendor folder, a composer.json and composer.lock file, etc) and type composer require guzzlehttp/guzzle:'^7'.

3
  • After that change we'd have to do composer update correct? Commented Nov 4, 2022 at 11:55
  • No it doesn't seem to need that. If you feel adventurous you can do composer update, or add -W to the require command, but then you might get some versions of packages that haven't been well-tested with civi (although it would probably be similar to the versions that get installed with drupal 8).
    – Demerit
    Commented Nov 4, 2022 at 14:32
  • 1
    Running this command has corrected the error with the ScormCloud plugin which is the priority. I will test the other plugin over the weekend. Thanks for the info!!
    – KilakwaBT
    Commented Nov 4, 2022 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.