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
PHP Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 2: easy handle already used in multi handle #2617
Comments
Updated curl to v7.69.1. Issue persists |
What do you mean by this? The curl cli binary you might have on your machine is not related to lib-curl. |
Sorry, by 'issue persists' I mean the error is the same. There is a possible solution on stackoverflow but it applies to Stripe and I have no idea how to implement it in Guzzle |
I mean what did you mean by updated curl? |
Upgraded the curl version |
What do you see when you run |
7.69.1 And all is well again. I have removed curl & libcurl from yum so that they do not update. I guess that's not the ideal solution but the only one I am able to implement in order to get my scripts working. Thanks |
I get the same problem, GuzzleHttp\Exception\RequestException: cURL error 2:, this appear when on godaddy service active ssl with some browser not working (safari, firefox), I`ve the same configuration. Before a long days my fix, Put StreamHandler instead of CurlHandler |
It helped me to configure the client as follows:
However, I still think there is a bug somewhere. It stopped working on its own, nothing has changed neither in the app or on the server. EditI was told that there may had been an automatic update as we use cPanel on that server. Unfortunately, I don't know more. |
Hi, some of our users are also reporting this issue: https://wordpress.org/support/topic/curl-error-2-easy-handle-already-used-in-multi-handle/ In our WP plugin: WP Mail SMTP we are using "google/apiclient" lib and it requires guzzle. I can't reproduce this issue on my shared hosting or locally. There were no changes to the plugin code when this issue started appearing for our users. @EsSa55 When you say "All is well again", does that mean that the error is no longer present for you? Did cURL update on your server when these errors started to appear? Did you downgrade to an older version of cURL in order to resolve this issue? |
@capuderg That's right. The error is no longer present, having requested my server host to downgrade cURL + libcurl to the previous version. curl -V |
Before a long days my fix, replace StreamHandler instead of CurlHandler |
Posted by @matt on https://stackoverflow.com/questions/61285075/php-fatal-error-uncaught-guzzlehttp-exception-requestexception-curl-error-2-e?noredirect=1#comment108426410_61285075 Temporary fix: Just in case anyone reading this is using Laravel. We suddenly started having the same problem a few days ago, tried installing different cURL versions and setting cURL options, nothing worked. I fixed it by changing the vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php file. Look for the line that says if (count($this->handles) >= $this->maxHandles) { curl_close($resource); In other words no matter what the handles count is you always close the cURL connection. This worked instantly for us! I thought the cURL version downgrade was the 'fix', but it worked for just 2 days. |
@EsSa55 I got inspired by this solution but instead of commenting out packaged lines of code I kind of forced the condition to be always true, therefore closing a resource every time. In my previous comment the number 0 is assigned to |
@pavelgajdos As a non-programmer, I was able to follow the instruction re specific commenting out. However, I am lost as to where/how your solution is applied re 'configure the client'. |
@EsSa55 In this case you are better off with commenting the lines out even though it is not as clean solution as mine or @ingberrio's :-) Applying my solution heavily depends on your specific software and a guide, which would cover most possible situations in your code, would be too long and unnecessary for this issue. Anyway, I hope we will know a cause of this bug or there will be a hotfix soon. |
This does not tell you the version of libcurl PHP is using. |
Can someone confirm this is an issue caused in this package? I’m getting reports of this issue in one of my packages that requires guzzle, but cannot reproduce it. |
This issue is also being encountered in Stripes' php client, with reference to guzzle: |
I also believe this issue is being encountered with https://github.com/awesomemotive/WP-Mail-SMTP, for their gmail integration which also uses guzzle. |
From https://curl.haxx.se/libcurl/c/libcurl-errors.html
and from https://cdcvs.fnal.gov/redmine/projects/simons-dm/wiki/Curl_Error_Codes
Also from the original author:
So now let's head there: https://github.com/guzzle/guzzle/blob/6.2.3/src/Handler/CurlFactory.php#L162 🤔 |
The only versions that I found this line match is 6.0.0 and 6.0.1 https://github.com/guzzle/guzzle/blob/6.0.1/src/Handler/CurlFactory.php#L162 Please check your setup and use an updated version. |
@gmponos thanks for this. Guzzle is embedded as a dependency so I don't fully have access over this, however it does at least help isolate the problem. I'll investigate the versions bundles with the two plugins that have it as a dependency and confirm. If it turns out the guzzle version is the issue and not guzzle itself it could mean this issue can be closed. |
In the WP Mail SMTP plugin the lowest Guzzle version that was used for a couple of releases now was '6.4.1'. Even when this issue started to occur for our users the plugin used that version... Here are some updates from the users experiencing this issue: https://wordpress.org/support/topic/curl-error-2-easy-handle-already-used-in-multi-handle/page/3/ A lot of users reported they are hosting on GoDaddy. Is this maybe a GoDaddy specific issue? |
I'm pretty sure it's not godaddy; I think it might be something to do with CentOS (I've seen other centOS users report similar things - do you know if your godaddy users are on CentOS systems @capuderg ?) |
Firstly I can't safely exclude that this couldn't be a guzzles issue.. but I would like to have a stack trace that I can trust. Secondly (not a WP expert) but unless you are using wppackagist then AFAIK WP plugins include all their vendor in the install right? How does the autoloading behaves when two plugins include in their vendors If this "could" be an issue then what is the composer version used to generate the autoloading files for each version of you WP plugin? |
@Gaffen I don't have any additional info on their systems, apart from the info on the forum post I pasted above. Sorry. |
@gmponos If two WP plugins use the same composer package then the plugin that calls the autoload first will "register" the package and the second plugin's package will be ignored... I've asked a user to list all plugins that he uses and verified if there is some kind of conflict like this, but there was none. |
I am facing the same issue. I can't downgrade the things on the server. when we deployed the project the socialite plugin was working perfectly. suddenly it started throwing above error in the logs. please provide the solution asap. i also don't prefer to change in vendor files. |
I also facing this problem. PHP 5.6.40 (cli) (built: Jun 15 2020 20:46:06)
|
I had to use the temporary fix mentioned here. but I don't recommend this and the developer should come up with the solution asap. |
Downgrading the libcurl version resolved a similar issue for a Site Kit plugin user, as reported here. |
I'm in the (unique?) position where I'm managing a handful of Drupal sites. This error prevents some of them from retrieving information about project updates (the core Update module in Drupal 8/9 uses Guzzle to retrieve this information). Here's what I'm seeing:
Far from conclusive information to be sure, but it's looking like this issue might be version specific to cURL. I will try updating that specifically any come back with any results. |
As @gmponos shows, it is likely a curl issue. I’m closing this since nobody has shown a stack trace, a reproducible script or a reliable version of guzzle where this happens. Feel free to open a new issue if you can provide a short reproducible script. |
I am still getting this while using 2 packages (Packagist libraries) from different developers that have guzzle as a dependency. I am getting this using the Following: CURL: Guzzle Stack Trace: Any help would be greatly appreciated. |
Guzzle: 6.2.3
PHP: 7.3.16
Curl: 7.19.7
Description
Library used for Google Shopping API product feeds
Feeds worked successfully every 20 minutes for 2 years and first 5 hours of 17 April 2020
Then:
PHP Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 2: easy handle already used in multi handle (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in ../vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:162
Stack trace:
#0 ../vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(129): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 ../vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(89): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 ../vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 ../vendor/guzzlehttp/guzzle/src/Handl in ../vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 162
No change to server, site configuration or any associated php or library files.
Same error every time the script now runs.
I am not a programmer but can follow instructions!
Any leads or guidance will be appreciated as the feed developer is no longer available.
TIA
The text was updated successfully, but these errors were encountered: