S3-Uploads icon indicating copy to clipboard operation
S3-Uploads copied to clipboard

Collision between Guzzle and various other plugins that all use their own composer layers

Open wtatters opened this issue 4 years ago • 2 comments

Fatal error: Uncaught Error: Call to undefined method GuzzleHttp\Utils::chooseHandler() in /srv/kindharvest.ag/html/vendor/guzzlehttp/guzzle/src/functions.php:61 Stack trace: #0 /srv/kindharvest.ag/html/wp-content/plugins/wp-vimeo-videos-pro/vendor/guzzlehttp/guzzle/src/HandlerStack.php(42): GuzzleHttp\choose_handler() #1 /srv/kindharvest.ag/html/wp-content/plugins/wp-vimeo-videos-pro/vendor/guzzlehttp/guzzle/src/Client.php(65): GuzzleHttp\HandlerStack::create() #2 /srv/kindharvest.ag/html/vendor/aws/aws-sdk-php/src/Handler/GuzzleV6/GuzzleHandler.php(26): GuzzleHttp\Client->__construct() #3 /srv/kindharvest.ag/html/vendor/aws/aws-sdk-php/src/functions.php(279): Aws\Handler\GuzzleV6\GuzzleHandler->__construct() #4 /srv/kindharvest.ag/html/vendor/aws/aws-sdk-php/src/Sdk.php(557): Aws\default_http_handler() #5 /srv/kindharvest.ag/html/wp-content/plugins/s3-uploads/inc/class-plugin.php(367): Aws\Sdk->__construct() #6 /srv/kindharvest.ag/html/wp-content/plugins/s3-uploads/inc/class-plugin.php(326): S3_Uploads\Plugin->get_aws_s in /srv/kindharvest.ag/html/vendor/guzzlehttp/guzzle/src/functions.php on line 61


Anyone have any thoughts on how to deal with this sort of issue - it seems to be more common that it was previously

Westa

wtatters avatar May 05 '21 09:05 wtatters

Try using the fork of Guzzle in my repositories. I had a similar issue, so I modified Guzzle to not have any conflicts. https://github.com/alifeinbinary/guzzle @wtatters

alifeinbinary avatar Jun 16 '21 01:06 alifeinbinary

I am using the manual install. Can this be updated and pushed for the next release? I am have the same issue: [06-Aug-2021 20:11:06 UTC] PHP Fatal error: Uncaught Error: Call to undefined method GuzzleHttp\Utils::chooseHandler() in /var/www/html/wp-content/plugins/manual-install-1/vendor/guzzlehttp/guzzle/src/functions.php:61 Stack trace: #0 /var/www/html/wp-content/plugins/woocommerce-bookings/vendor/guzzlehttp/guzzle/src/HandlerStack.php(42): GuzzleHttp\choose_handler() #1 /var/www/html/wp-content/plugins/woocommerce-bookings/vendor/guzzlehttp/guzzle/src/Client.php(65): GuzzleHttp\HandlerStack::create() #2 /var/www/html/wp-content/plugins/woocommerce-bookings/vendor/google/apiclient/src/Client.php(1190): GuzzleHttp\Client->__construct() #3 /var/www/html/wp-content/plugins/woocommerce-bookings/vendor/google/apiclient/src/Client.php(1143): Google\Client->createDefaultHttpClient() #4 /var/www/html/wp-content/plugins/woocommerce-bookings/vendor/google/apiclient/src/Client.php(411): Google\Client->getHttpClient() #5 /var/www/html/wp-content/plugins/woocommerce-bookings/vendor/google/apiclient/src/Client.php(891): Google\Client->authorize() #6 /var/www/html/wp-con in /var/www/html/wp-content/plugins/manual-install-1/vendor/guzzlehttp/guzzle/src/functions.php on line 61

djviruss avatar Aug 06 '21 20:08 djviruss

Currently have the error reporting by OP. Any sign of a solution?

dmpinder avatar Jul 12 '23 12:07 dmpinder

There's little to nothing that can be done for this from a project pOV as it's not an S3 Uploads issue, but a general issue with multiple manual composer setups loaded at once. I've seen it in the past when Yoast SEO used google SDK dependencies that then clashed with those of other plugins.

The solution is usually to install all the dependencies that use Guzzle via a single composer.json, composer then figures out which version is compatible with all of them. Short of asking all of them to upgrade Guzzle within a short window of each other it's unlikely there's a non-composer solution to this, and it may well be that no solution exists for those trying to manually install this as a zip.

You could also install S3 Uploads via composer as a dependency with additional Guzzle requirements in a separate composer.json if you know the specific Guzzle versions you need to match.

Note that it's still possible that there would be no overlap and the dependencies cannot be satisfied.

As for changes this plugin could make, S3 Uploads doesn't depend on Guzzle directly, it's most likely the Amazon SDK which is at "aws/aws-sdk-php": "~3.18", which shouldn't prevent newer versions of the SDK or Guzzle being installed by composer. The best that could be hoped for is bumping the versions of those if they're out of date and unable to pull in the latest version, but it's more likely that S3 Uploads has it already and it's the other plugins that are out of date.

Consider contacting the wp-vimeo-videos-pro and woocommerce-bookings authors and asking them to ensure they bundled the newest version of Guzzle in their pre-packaged versions of their plugins. This will help the situation though it may not solve it.

tomjn avatar Jul 20 '23 10:07 tomjn

Re: Manual installs https://github.com/humanmade/S3-Uploads/pull/645

tomjn avatar Jul 20 '23 10:07 tomjn

Closing as we're going to require installation via Composer (#644), which will handle dependency resolution.

rmccue avatar Jul 20 '23 10:07 rmccue