amphp / http-client

An advanced async HTTP client library for PHP, enabling efficient, non-blocking, and concurrent requests and responses.

Home Page:https://amphp.org/http-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Curl Could Not Resolve Host

mztlive opened this issue · comments

The introduction of amp/http-client will cause guzzlehttp to trigger the could not resolve host exception (occasionally)

It should be noted that: only composer refers to amp/http-client, and does not use any code inside

When I removed the dependency of amp/http-client from composer, everything returned to normal, and it was the same result after repeated testing.

Do you use Symfony's HTTP client?

Do you use Symfony's HTTP client?

No, I Use GuzzleHttp Client

Will there be problems using symfony HttpClient?

No, but there I'm aware of it automatically switching the client implementation if amphp/http-client is installed.

What's the stack trace?

No, but there I'm aware of it automatically switching the client implementation if amphp/http-client is installed.

What's the stack trace?

GuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: *****; Unknown error (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:200
Stack trace:
#0 /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection()
#1 /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError()
#2 /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish()
#3 /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke()
#4 /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}()
#5 /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(66): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}()
#6 /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/Middleware.php(29): GuzzleHttp\PrepareBodyMiddleware->__invoke()
#7 /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(70): GuzzleHttp\Middleware::GuzzleHttp\{closure}()
#8 /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/Middleware.php(59): GuzzleHttp\RedirectMiddleware->__invoke()
#9 /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/HandlerStack.php(71): GuzzleHttp\Middleware::GuzzleHttp\{closure}()
#10 /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/Client.php(351): GuzzleHttp\HandlerStack->__invoke()
#11 /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/Client.php(162): GuzzleHttp\Client->transfer()
#12 /data/wwwroot/dir/vendor/guzzlehttp/guzzle/src/Client.php(182): GuzzleHttp\Client->requestAsync()
#13 /data/wwwroot/dir/vendor/wandou/libpub/src/Auth/Authorization.php(375): GuzzleHttp\Client->request()
#14 /data/wwwroot/dir/vendor/wandou/libpub/src/Service/Helper/Bus.php(176): Auth\Authorization->getBasicsService()
#15 /data/wwwroot/dir/vendor/wandou/libpub/src/Service/Bus/Edu.php(120): WanDouLib\Service\Helper\Bus::post()
#16 /data/wwwroot/dir/app/punch/repository/UserTagRepository.php(173): WanDouLib\Service\Bus\Edu::getUserAccuracy()
#17 /data/wwwroot/dir/app/punch/logic/poster/PosterTag.php(239): app\punch\repository\UserTagRepository->getStudentAccuracy()
#18 /data/wwwroot/dir/app/punch/logic/poster/PosterTag.php(56): app\punch\logic\poster\PosterTag->getStudentAccuracy()
#19 /data/wwwroot/dir/app/punch/controller/front/Poster.php(111): app\punch\logic\poster\PosterTag->getUserTagInfo()
#20 [internal function]: app\punch\controller\front\Poster->getTagData()
#21 /data/wwwroot/dir/vendor/topthink/framework/src/think/Container.php(343): ReflectionMethod->invokeArgs()
#22 /data/wwwroot/dir/vendor/topthink/framework/src/think/route/dispatch/Controller.php(110): think\Container->invokeReflectMethod()
#23 /data/wwwroot/dir/vendor/topthink/framework/src/think/Pipeline.php(59): think\route\dispatch\Controller->think\route\dispatch\{closure}()
#24 /data/wwwroot/dir/vendor/topthink/framework/src/think/Pipeline.php(66): think\Pipeline->think\{closure}()
#25 /data/wwwroot/dir/vendor/topthink/framework/src/think/route/dispatch/Controller.php(113): think\Pipeline->then()
#26 /data/wwwroot/dir/vendor/topthink/framework/src/think/route/Dispatch.php(89): think\route\dispatch\Controller->exec()
#27 /data/wwwroot/dir/vendor/topthink/framework/src/think/Route.php(772): think\route\Dispatch->run()
#28 /data/wwwroot/dir/vendor/topthink/framework/src/think/Pipeline.php(59): think\Route->think\{closure}()
#29 /data/wwwroot/dir/app/common/middleware/AuthorizationByFrontMiddleware.php(45): think\Pipeline->think\{closure}()
#30 [internal function]: app\common\middleware\AuthorizationByFrontMiddleware->handle()
#31 /data/wwwroot/dir/vendor/topthink/framework/src/think/Middleware.php(142): call_user_func()
#32 /data/wwwroot/dir/vendor/topthink/framework/src/think/Pipeline.php(85): think\Middleware->think\{closure}()
#33 /data/wwwroot/dir/vendor/topthink/framework/src/think/Pipeline.php(66): think\Pipeline->think\{closure}()
#34 /data/wwwroot/dir/vendor/topthink/framework/src/think/Route.php(773): think\Pipeline->then()
#35 /data/wwwroot/dir/vendor/topthink/framework/src/think/Http.php(216): think\Route->dispatch()
#36 /data/wwwroot/dir/vendor/topthink/framework/src/think/Http.php(206): think\Http->dispatchToRoute()
#37 /data/wwwroot/dir/vendor/topthink/framework/src/think/Pipeline.php(59): think\Http->think\{closure}()
#38 /data/wwwroot/dir/vendor/topthink/think-multi-app/src/MultiApp.php(71): think\Pipeline->think\{closure}()
#39 /data/wwwroot/dir/vendor/topthink/framework/src/think/Pipeline.php(59): think\app\MultiApp->think\app\{closure}()
#40 /data/wwwroot/dir/vendor/topthink/framework/src/think/Pipeline.php(66): think\Pipeline->think\{closure}()
#41 /data/wwwroot/dir/vendor/topthink/think-multi-app/src/MultiApp.php(72): think\Pipeline->then()
#42 [internal function]: think\app\MultiApp->handle()
#43 /data/wwwroot/dir/vendor/topthink/framework/src/think/Middleware.php(142): call_user_func()
#44 /data/wwwroot/dir/vendor/topthink/framework/src/think/Pipeline.php(85): think\Middleware->think\{closure}()
#45 /data/wwwroot/dir/vendor/topthink/think-trace/src/TraceDebug.php(71): think\Pipeline->think\{closure}()
#46 [internal function]: think\trace\TraceDebug->handle()
#47 /data/wwwroot/dir/vendor/topthink/framework/src/think/Middleware.php(142): call_user_func()
#48 /data/wwwroot/dir/vendor/topthink/framework/src/think/Pipeline.php(85): think\Middleware->think\{closure}()
#49 /data/wwwroot/dir/vendor/topthink/framework/src/think/Pipeline.php(66): think\Pipeline->think\{closure}()
#50 /data/wwwroot/dir/vendor/topthink/framework/src/think/Http.php(207): think\Pipeline->then()
#51 /data/wwwroot/dir/vendor/topthink/framework/src/think/Http.php(170): think\Http->runWithRequest()
#52 /data/wwwroot/dir/public/index.php(20): think\Http->run()
#53 {main}

** For security reasons, I replaced the domain name with ***** **

By the way, me domain name is intranet

It seems like Guzzle is indeed using curl, so it seems unlikely to be an issue caused by this package. If the issue does indeed repeatedly re-appear on installation, I suggest opening an issue for Guzzle, but I'm not aware of behavior changes based on package installation except for the Symfony HTTP client automatically switching implementations, which isn't the case here.