-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
symfony/polyfill-intl-idn 1.16 broken Guzzle for CentOS 6 (old ICU) servers? #262
Comments
Do you happen to know why? Can you send a fix or at least spot the PR at fault? |
Don't know, but every single use is now failing with 'IDN conversion failed' exception message. Running latest guzzle/guzzle. |
@jonnott do you have the @nicolas-grekas I think it might be related to #252. By checking each constant separately, we will define missing For constants related to new features, they should be defined only if our polyfill implementation is used, when they will impact the potential feature detection (guzzle does some feature detection on |
@stof good catch! that's going to be fun to patch :) |
I can confirm the cause. |
System: Linux {hostname} 2.6.32-754.11.1.el6.x86_64 #1 SMP Tue Feb 26 15:38:56 UTC 2019 x86_64 PHP Version: 7.3.17 intl Enabled /opt/cpanel/ea-php73/root/etc/php.d/20-intl.ini Composer:
|
@nicolas-grekas We will have to identify constants related to configuring features of a function vs constants being a feature themselves. The second category can have independant checks. The first category need to be taken carefully (especially when the constants are not always all defined in PHP itself based on conditional features or PHP versions). |
Actually, having now force my versions of symfony/polyfill-* back to 1.15.0 via composer, the problems still persist. So goodness knows what's going on. guzzle/guzzle version hasn't been updated since 21/04/2020 (for me) - to latest 6.5.3 |
I can confirm symfony/polyfill-intl-idn@1.15 and guzzlehttp/guzzle@6.5.3 works. |
@alex-dev ..but is that on CentOS 6 with ICU 4.2.1 ? |
CentOS 6.9.e19.12.3 x86_64 |
Well. That's a heavy handed fix. It works. |
@fabpot @nicolas-grekas @alex-dev Still getting 'IDN conversion failed' on all Guzzle Client requests, unless I specifically set 'idn_conversion=>false' Now using 1.17.0 of this lib, and latest Guzzle 6.5.3 Guzzle 6.5.1 fixed this issue so I could drop 'idn_conversion=>false', but now the problem is back and I don't know why. Upping to 6.5.3 didn't cause this regression I don't think, but the problem seems to be there whether I'm using 1.15, 1.16 or 1.17 of polyfill-intl-idn :( |
Issue is fixed by guzzle/guzzle#2626 btw |
Thanks for the link. Did you try previous versions? What is causing the issue? Wrong code in guzzle? |
I am puzzled as to the exact cause. Guzzle requests seemed to break (according to my application logs) when composer updated this polyfill lib from 1.15 to 1.16. Then 1.17 came out and didn't fix it. So I reverted to 1.15, but that didn't fix it either! So it may have been due to something else going on on the server (minor PHP 7.3.x update via WHM update maybe?) .. but all the while Guzzle was still on 6.5.3 and that's been out for a while now. Wish I knew the answer. I wasn't the first time I'd had to use the ['idn_conversion'=>false] option for GuzzleHttp\Client to work around this, but Guzzle 6.5.1 seemed to fix the problem .. then somehow it's resurfaced (so I'm back to using that 'idn_conversion' option until a new release of Guzzle comes out with that PR merged). |
It's in-fact TOO heavy-handed in the case of this particular polyfill class, because there are situations where the intl extension is loaded, but the ICU version available on the machine is unusable by the native PHP implementation (e.g. UCI 4.2.1). It should not be simply bypassing the polyfill if it detects the intl extension is loaded, rather it should be working out whether to use the native implementation or not based on the INTL_IDNA_VARIANT_UTS46 constant, as Utils::idnUriConvert() is currently doing in Guzzle. |
That seems like a better approach for a polyfill. Everyone uses the latest API, and the polyfill check the actual implementation to know if it should shim itself in-between, replace it completely or leave it. |
FWIW, today the update to
symfony/polyfill-intl-idn
v1.16 (from 1.15) just completely broke all my Guzzle usages. This is on a server running CentOS 6 (and therefore old ICU - 4.2.1?) and PHP 7.3The text was updated successfully, but these errors were encountered: