Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wtatters opened this issue May 5, 2021 · 5 comments

Comments

@wtatters
Copy link

wtatters commented May 5, 2021

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

@djviruss
Copy link

djviruss commented Aug 6, 2021

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

@dmpinder
Copy link
Contributor

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

@tomjn
Copy link
Contributor

tomjn commented Jul 20, 2023

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
Copy link
Contributor

tomjn commented Jul 20, 2023

Re: Manual installs #645

@rmccue
Copy link
Member

rmccue commented Jul 20, 2023

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

@rmccue rmccue closed this as not planned Won't fix, can't repro, duplicate, stale Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants