Skip to content

cURL error 6: Could not resolve host: router #255

Open
@Vugario

Description

@Vugario

Description

When using the agent version 9.18.1.303 in combination with guzzlehttp 7.3.0 our requests are sometimes changed to have the host "router". We make a simple API call to any url, and it ends up performing a curl request to router which in turn throws an exception:
cURL error 6: Could not resolve host: router
We noticed this problem in our production environment where we perform many API calls. Most of them succeeded but after a while, some are failing with this described issue. When this error occurs, some API calls still succeed so the error is only happening for a small subset of requests, making this issue very difficult to find and debug.

It took us many days to realize this was the cause, but when reverting NewRelic back to its previous release this issue was resolved.

Steps to Reproduce

  1. Docker/kubernetes environment based on php:8.0-fpm-alpine3.13 with the new relic agent version 9.18.1.303 and GuzzleHttp 7.3.0
  2. Make a simple API request with Guzzle
$client = new GuzzleHttp\Client(['base_uri' => 'https://foo.com/api/']);
$response = $client->request('GET', 'test');
  1. This first number of API calls are executed without a problem. After a while, some API requests are changed to be sent to router instead of to https://foo.com/api/test

Expected Behavior

The request should be sent to https://foo.com/api/test instead of to router which fails the request
NOTE: # ( Tell us what you expected to happen. )

Relevant Logs / Console output

This is our stacktrace, which is no different for the failed requests as for the successful ones (except for the exception handling at the end of course).

vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:210 GuzzleHttp\Handler\CurlFactory::createRejection    
vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:158 GuzzleHttp\Handler\CurlFactory::finishError    
vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:110 GuzzleHttp\Handler\CurlFactory::finish 
vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php:47 GuzzleHttp\Handler\CurlHandler::__invoke    
vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:28 GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}    
vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:48 GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}    
vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php:35 GuzzleHttp\PrepareBodyMiddleware::__invoke    
vendor/guzzlehttp/guzzle/src/Middleware.php:31 GuzzleHttp\Middleware::GuzzleHttp\{closure}  
vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php:71 GuzzleHttp\RedirectMiddleware::__invoke  
vendor/guzzlehttp/guzzle/src/Middleware.php:63 GuzzleHttp\Middleware::GuzzleHttp\{closure}  
vendor/guzzlehttp/guzzle/src/HandlerStack.php:75 GuzzleHttp\HandlerStack::__invoke  
vendor/guzzlehttp/guzzle/src/Client.php:331 GuzzleHttp\Client::transfer 
vendor/guzzlehttp/guzzle/src/Client.php:168 GuzzleHttp\Client::requestAsync 
vendor/guzzlehttp/guzzle/src/Client.php:187 GuzzleHttp\Client::request  
vendor/guzzlehttp/guzzle/src/Client.php:92 GuzzleHttp\Client::__call

Your Environment

We run on GKE with a Docker file based on php:8.0-fpm-alpine3.13.
GuzzleHttp version 7.3.0
NewRelic agent 9.18.1.303
TIP: # ( Include as many relevant details about your environment as possible. )

  • ex: Browser name and version:
  • ex: Operating System and version:

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions