Uncaught guzzlehttp exception requestexception



PHP Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 2: easy handle already used in multi handle #2617

Comments

EsSa55 commented Apr 18, 2020 •

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

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.

The text was updated successfully, but these errors were encountered:

EsSa55 commented Apr 18, 2020

Updated curl to v7.69.1. Issue persists

GrahamCampbell commented Apr 18, 2020

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.

EsSa55 commented Apr 18, 2020

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

GrahamCampbell commented Apr 18, 2020

I mean what did you mean by updated curl?

EsSa55 commented Apr 18, 2020

Upgraded the curl version

GrahamCampbell commented Apr 18, 2020

What do you see when you run php -r ‘echo curl_version()[«version»];’ .

EsSa55 commented Apr 18, 2020 •

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.

ingberrio commented Apr 19, 2020 •

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

pavelgajdos commented Apr 20, 2020 •

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.

I was told that there may had been an automatic update as we use cPanel on that server. Unfortunately, I don’t know more.

capuderg commented Apr 20, 2020

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?

Читайте также:  Viewing apache error log

EsSa55 commented Apr 20, 2020 •

@capuderg That’s right. The error is no longer present, having requested my server host to downgrade cURL + libcurl to the previous version.
cURL did update automatically on my server. Sorry, I don’t actually know what the new version was.

curl -V
curl 7.69.1 (x86_64-redhat-linux-gnu) libcurl/7.69.1 OpenSSL/1.0.1e-fips zlib/1.2.3 c-ares/1.16.0 libssh2/1.8.2
Release-Date: 2020-03-11
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTPS-proxy IPv6 Kerberos Largefile libz Metalink NTLM NTLM_WB SPNEGO SSL UnixSockets

ingberrio commented Apr 20, 2020

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.

I was told that there may had been an automatic update as we use cPanel on that server. Unfortunately, I don’t know more.

Before a long days my fix, replace StreamHandler instead of CurlHandler

EsSa55 commented Apr 21, 2020

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);
> else <
.
>
Comment this all out, and instead of the if/else just write

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.

pavelgajdos commented Apr 21, 2020

@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 $this->maxHandles

EsSa55 commented Apr 21, 2020

@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’.

pavelgajdos commented Apr 21, 2020

@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.

GrahamCampbell commented Apr 21, 2020

This does not tell you the version of libcurl PHP is using.

sandervanhooft commented May 3, 2020

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.

Gaffen commented May 7, 2020

This issue is also being encountered in Stripes’ php client, with reference to guzzle:
stripe/stripe-php#918

Gaffen commented May 27, 2020

I also believe this issue is being encountered with https://github.com/awesomemotive/WP-Mail-SMTP, for their gmail integration which also uses guzzle.

Читайте также:  Wine ssl security error

gmponos commented May 27, 2020

CURLE_FAILED_INIT (2)
Very early initialization code failed. This is likely to be an internal error or problem, or a resource problem where something fundamental couldn’t get done at init time.

If we ever get this from our probe script, it means we have a broken version of curl on the system we are using, which can’t find its own parts. So the user installed their own curl and it didn’t build correctly, etc. Have them check their PATH command search path etc. installed packages, etc.

Also from the original author:

Guzzle: 6.2.3
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

gmponos commented May 27, 2020 •

Please check your setup and use an updated version.

Gaffen commented May 28, 2020

@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.

capuderg commented May 28, 2020

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.

A lot of users reported they are hosting on GoDaddy. Is this maybe a GoDaddy specific issue?

Gaffen commented May 28, 2020

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 ?)

gmponos commented May 28, 2020 •

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 Guzzle ? Maybe another plugin is using outdated guzzle version and it’s the reason we have this stack trace?

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?

capuderg commented May 29, 2020

@Gaffen I don’t have any additional info on their systems, apart from the info on the forum post I pasted above. Sorry.

capuderg commented May 29, 2020

@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.

Читайте также:  The software change returned error code 0x87d00325 2016410843

amitshahc commented Jun 6, 2020

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.

Sensetivity commented Jul 2, 2020 •

I also facing this problem.

PHP 5.6.40 (cli) (built: Jun 15 2020 20:46:06)
cURL 7.69.1
guzzlehttp/guzzle 6.5.5

Exception ‘Google\Cloud\Core\Exception\ServiceException’ with message ‘cURL error 2: easy handle already used in multi handle (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)’

amitshahc commented Aug 11, 2020

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);
> else <
.
>
Comment this all out, and instead of the if/else just write

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.

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.

jamesozzie commented Aug 11, 2020

Downgrading the libcurl version resolved a similar issue for a Site Kit plugin user, as reported here.

irondan commented Aug 14, 2020

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:

Test Drupal Version PHP Version cURL Version Fails With error 2
Site 1 Prod 8.9.3 7.3.21 7.71.1 No
Site 1 Stage 8.9.3 7.3.20 7.71.0 No
Site 2 Prod 8.9.2 7.2.33 7.71.1 No
Site 2 Stage 8.9.2 7.2.33 7.69.1 Yes
Site 3 Prod 8.9.3 7.3.14 7.29.0 No
Site 3 Stage 8.9.3 7.3.21 7.69.1 Yes
Site 4 9.0.3 7.4.8 7.29.0 No

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.

Nyholm commented Oct 10, 2020

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.

ItsMeStevieG commented Jan 29, 2021

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:
curl 7.74.0 (x86_64-apple-darwin20.2.0) libcurl/7.74.0 (SecureTransport) OpenSSL/1.1.1i zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.0 libssh2/1.9.0 nghttp2/1.42.0 librtmp/2.3 Release-Date: 2020-12-09 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp Features: alt-svc AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz Metalink MultiSSL NTLM NTLM_WB SPNEGO SSL TLS-SRP UnixSockets zstd

Guzzle
guzzlehttp/guzzle (7.2.0)

Источник

Оцените статью
toolgir.ru
Adblock
detector