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
INTL_IDNA_VARIANT_2003 is deprecated #2620
Comments
I guess this is happening on this line: https://github.com/guzzle/guzzle/blob/6.5/src/Utils.php#L33. |
That constant should be defined, however: https://github.com/symfony/polyfill-intl-idn/blob/master/bootstrap.php#L37. |
What extensions do you have? |
That is not your lock file. |
Hi GrahamCampell, I just did a PHP upgrade from 7.3 to 7.4, then do a composer update and everything worked fine. Thanks! BTW: I suposse INTL_IDNA_VARIANT_UTS46 and INTL_IDNA_VARIANT_2003 are defined on other symfony package. Thanks! |
Guzzle should also work on PHP 7.3, so we'd like to know what was going wrong. |
Fyi; i'm (was) having the same issue Guzzle version(s) affected: 6.5.3 I downgraded to 6.5.2 to fix the issue. |
Just to clarify, do you have the intl extension installed, or not? |
@GrahamCampbell; intl is installed.
|
@GrahamCampbell i think it's caused by adding the symfony/polyfill-intl-idn package and/or removing your custom check (source) My complete error was: production.ERROR: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated {"exception":"[object] (ErrorException(code: 0): idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated at /httpdocs/vendor/guzzlehttp/guzzle/src/Utils.php:35) Because the package is triggering the error: Hope this helps. If i need to test anything, please let me know! |
Odd. That package code should never be run if the extension is loaded. Are you sure it is that line that's running, and not the same line in the C code? |
Hmm, you right. The problem is; it was (and is) working fine when i use Guzzle version 6.5.2 but errors out on version 6.5.3 on: Maybe it's a server issue ? Do you have any idea ? When i run the following test script: <?php
echo "<pre>";
echo "idn_to_ascii function_exists: "; var_dump(function_exists('idn_to_ascii'));
echo "<br><br>";
$idnaVariant = defined('INTL_IDNA_VARIANT_UTS46') ? INTL_IDNA_VARIANT_UTS46 : 0;
echo "idnaVariant: "; var_dump($idnaVariant);
echo "<br><br>";
echo "PHP_VERSION_ID: "; var_dump(PHP_VERSION_ID);
echo "<br><br>";
echo "idn_to_ascii test: "; var_dump(idn_to_ascii('google.com', 0));
echo "<br><br>";
echo "</pre>"; i get the following: idn_to_ascii function_exists: bool(true)
idnaVariant: int(0)
PHP_VERSION_ID: int(70230)
idn_to_ascii test: string(10) "google.com" (so then it does not throw a error).. |
To confirm if the symfony code is being run can you add a var_dump or something before their code would have raised the deprecation warning? |
Does #2626 fix your issue? |
Having this issue as well guys. PHP 7.3 intl PHP extension's loaded. Here's a stack trace because no one's posted one yet. This isn't a hard fix. I'll submit a pull if it wasn't 4am in Canada.
|
I have already prepared a PR, as I said. Please try it out and tell me if it fixes your issue. |
I'm not that good with composer; how can i try this out ? (What do i need to require / put in my composer.json?) |
Ah, jeeze. I'm so sorry @GrahamCampbell. Chalk that up to being awake until 4am. This was a production issue, and I had to put the fire out pretty quickly. I ended up downgrading: PHP 7.3 > 7.2 All at once, to fix the bug in the prod environment. I'm back online later. Can we link your PR to this issue? I'd love to get us back on the latest version(s) soon. |
The PR is linked to the issue? |
Sorry for the delay; @GrahamCampbell I can confirm that this fixes the issue on my end. |
Any idea when it will be merged in ? 😄 (No rush, but just asking) |
Not sure. It needs a review from the Guzzle core, and as much community feedback as possible. |
We need to make absolutely sure that the next Guzzle 6.x release works properly, and doesn't break anything else. |
had to do the same, fixed the issue for now |
@Dahdoul Please try with the patch. It is not useful to know that downgrading fixed it for you, because we have already established that there is a bug. What is only useful know is to know if the proposed fix actually fixes it for you. |
already applied the patch and it fixes the issue (PHP 7.3.17). I had to downgrade before just to fix the bug in production env. |
got the same error
|
@GrahamCampbell sorry. I just applied manually the #2626 patch you made. and it worked |
I faced the same issue: on local windows pc php intl on local machine:
intl on server:
|
Hello, I've been trying to fix this error too. What should I do this file? |
Don't edit any of those files. Does #2626 fix your issue? |
@GrahamCampbell I'm kinda stuck applying #2626. Should I edit Utils.php file? |
In src/Utils.php I see some additions to the code, do I add these lines?
…On Tue, May 5, 2020 at 10:18 PM Graham Campbell ***@***.***> wrote:
Don't edit any of those files. Does #2626
<#2626> fix your issue?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2620 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AID2636ZM25Y7ZUZFPBSJ2LRQBQ7RANCNFSM4MMC5DCA>
.
|
Guzzle version(s) affected: 6.5.3 update "symfony/polyfill-intl-idn":"v1.16.0" An error IDN conversion failed occurred |
This pull #2626 resolve error |
#2626 is merged. |
i stll get ame error |
@flowser Are you installing the latest dev version? The code has not actually been tagged yet. |
Guzzle version(s) affected: 6.5.3
PHP version: 7.3.16 (hint:
php --version
)cURL version: 7.69.1 (hint:
php -i | grep cURL
)Description
My Telegram Bot is giving me this error when upgrade from 6.4.0 to 6.5.3:
idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated
in Utils.php line 35
at HandleExceptions->handleError(8192, 'idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated', '/home/erich33/vendor/guzzlehttp/guzzle/src/Utils.php', 35, array('uri' => object(Uri), 'options' => 0, 'idnaVariant' => 0))
How to reproduce
When somebody message to my Telegram Bot, I have a script which send to my email the Exceptions, and turns now a hell with this error.
Possible Solution
Downgrade to 6.4?
Something with symfony idn?
Additional context
My actual composer.lock:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.3",
"artesaos/seotools": "^0.17.1",
"binarytorch/larecipe": "^2.2",
"biscolab/laravel-recaptcha": "^4.0",
"facebook/graph-sdk": "^5.7",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.5",
"intervention/image": "^2.5",
"irazasyed/telegram-bot-sdk": "3.1.0",
"laravel-notification-channels/facebook": "^0.1.0",
"laravel-notification-channels/facebook-poster": "^2.0",
"laravel-notification-channels/telegram": "^0.3.0",
"laravel-notification-channels/twitter": "^3.0",
"laravel/framework": "^6.2",
"laravel/passport": "^8.4",
"laravel/socialite": "^4.1",
"laravel/tinker": "^2.2",
"overtrue/laravel-like": "^2.0",
"predis/predis": "^1.1",
"renatomarinho/laravel-page-speed": "^1.8",
"rennokki/befriended": "^3.0",
"rennokki/rating": "^2.0",
"spatie/laravel-permission": "^3.11",
"spatie/laravel-responsecache": "^6.3",
"spatie/laravel-sitemap": "^5.3",
"spatie/schema-org": "^2.2",
"tedivm/fetch": "^0.7.1"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2",
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^9.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"files": [
"app/Helpers/Helper.php"
],
"psr-4": {
"App\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan optimize",
"@php artisan view:clear",
"@php artisan cache:clear",
"@php artisan responsecache:clear"
],
"post-root-package-install": [
"@php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}
The text was updated successfully, but these errors were encountered: