Client timeout exceeded while awaiting headers
Asked Answered
S

2

13

I got below error, I am using go v1.10.4 linux/amd64.

I am not behind any firewall or whatsoever. New Relic in java server (same network segment) that we have runs fine.

We have tried:

  • Increasing the timeout to 60 seconds
  • Use http2 in the server
  • Using Postman return 503 with response:

    {"exception":{"message":"Server Error","error_type":"RuntimeError"}}

  • troubleshooting with ./nrdiag says “No Issues Found”

Below is our code:

    config := newrelic.NewConfig(os.Getenv("NEW_RELIC_APP_NAME"), os.Getenv("NEW_RELIC_KEY"))

    config.Logger = newrelic.NewDebugLogger(os.Stdout)

    app, err := newrelic.NewApplication(config)
    if err != nil {
        fmt.Println("Failed to create newrelic application", err)
        os.Exit(1)
    }

.................

        httpListener, err := net.Listen("tcp", *httpAddr)
        if err != nil {
            oldlog.Print("Error: ", err)
            logger.Log("transport", "HTTP", "during", "Listen", "err", err)
            os.Exit(1)
        }
        g.Add(func() error {
            logger.Log("transport", "HTTP", "addr", *httpAddr)
            return http.Serve(httpListener, nrgorilla.InstrumentRoutes(httpHandler, app))
        }, func(error) {
            httpListener.Close()
        })
    }

However this what we got,note some_key was removed:

(28422) 2019/07/29 18:08:50.058559 {"level":"warn","msg":"application connect failure","context":{"error":"Post https://collector-001.eu01.nr-data.net/agent_listener/invoke_raw_method?license_key=some_key\u0026marshal_format=json\u0026method=connect\u0026protocol_version=17: net/http: request canceled (Client.Timeout exceeded while awaiting headers)"}}

Snuffbox answered 30/7, 2019 at 10:2 Comment(2)
We found out that at that time the new relic SDK was still underdevelopment, it was fixed after we followed up with new relic engineering team directly and did update on the sdk once it was updated.Snuffbox
Was this an error related to their SDK implementation or a real backend issue causing by I/O timeouts?Tap
G
6

I think it is due to DNS network timeout.

You can easily test this out by using the following steps (in Ubuntu)

  1. Select the IPv4 Settings tab.
  2. Disable the “Automatic” toggle switch and enter the DNS resolvers' IP addresses, separated by a comma. We’ll use the Google DNS nameservers:

    8.8.8.8,8.8.4.4

If it works, then you may be able to reset the DNS to "Automatic"

Gelid answered 13/4, 2020 at 11:2 Comment(0)
I
0

On Windows OS, Running Linux Containers with WSL2, i followed the following steps,

  1. Ran the command docker logout
  2. Ran the command, docker network prune, so as to remove all the preconfigured settings of the network.
  3. From Docker Settings, Enabled the DNS server configuration with 8.8.8.8
  4. Restarted the Docker
  5. Now executed login command with registry to login, docker login {registry}
Impose answered 13/10, 2020 at 8:25 Comment(1)
I am using windows OS, this didn't work for me.Sloth

© 2022 - 2024 — McMap. All rights reserved.