Skip to content

net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) #374

Closed

Description

@eploko

I’m trying to follow through the hello-world tutorial and the pipeline bails out with the following error:

resource script '/opt/resource/check []' failed: exit status 1

stderr:
failed to ping registry: 2 error(s) occurred:

* ping https: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
* ping http: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

I’m running the Vagrant box. Here’s the output from dig inside the box:

$ dig registry-1.docker.io

; <<>> DiG 9.9.5-3ubuntu0.7-Ubuntu <<>> registry-1.docker.io
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53377
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;registry-1.docker.io.        IN    A

;; ANSWER SECTION:
registry-1.docker.io.    13    IN    CNAME    registry-origin.docker.io.
registry-origin.docker.io. 13    IN    A    52.20.152.217
registry-origin.docker.io. 13    IN    A    52.200.190.255
registry-origin.docker.io. 13    IN    A    52.22.205.209

;; Query time: 321 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu Apr 14 06:55:23 UTC 2016
;; MSG SIZE  rcvd: 127

And here’s from curl:

$ curl https://registry-1.docker.io/v2/
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}

So it seems the box networking works fine per se.
I’ll be happy if anyone has any clues on how to fix the setup...

This issue seems to be similar to #347, but it's not the DNS that seems to be the problem in this case.

Activity

  1. concourse-bot commented on Apr 14, 2016

    @concourse-bot

    Hi there!

    We use Pivotal Tracker to provide visibility into what our team is working on. A story for this issue has been automatically created.

    The current status is as follows:

    • #117600803 net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

    This comment, as well as the labels on the issue, will be automatically updated as the status in Tracker changes.

  2. evandbrown commented on Apr 15, 2016

    @evandbrown

    I'm seeing the same issue (with my own pipeline, not the tutorial). Concourse 1.1.0 deployed with BOSH on GCE. Occurring when a job tries to put to a resource.

    In my case, it appears a move from v1.0.0 to v1.1.0 triggered this. I'm reverting to 1.0.0 now to verify and will report back here.

  3. evandbrown commented on Apr 15, 2016

    @evandbrown

    The issue is happening in v1.0.0 as well.

  4. evandbrown commented on Apr 18, 2016

    @evandbrown

    I tracked my problem down to a bad DNS config. The first entry in resolv.conf was not responding and this 5s timeout in the docker-image-resource would trigger before the next DNS server in my resolv.conf would be used. Manually removing the bad/first entry solved it. Now to understand how /etc/resolv.conf got fubar'd...

  5. roguedan commented on Apr 29, 2016

    @roguedan

    hi @eploko : Did you receive a reply / solution to this? I've got the same issue

  6. davedcusack commented on May 27, 2016

    @davedcusack

    I'm getting the same issue when working through the flight-school tutorial

  7. MRosker commented on Jun 2, 2016

    @MRosker

    the vagrant box comes with 2 DNS servers: 8.8.8.8 and 10.0.2.3
    with this setup I could reach and resolve internet domains like www.google.com
    curl https://registry-1.docker.io/v2/
    gives as result
    {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}
    building a task with concourse did not work and gave output:

    resource script '/opt/resource/check []' failed: exit status 1
    
    stderr:
    failed to ping registry: 2 error(s) occurred:
    
    * ping https: Get https://registry-1.docker.io/v2: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
    * ping http: Get http://registry-1.docker.io/v2: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
    

    after adding our corporate DNS servers on top of the list in
    /etc/resolvconf/resolv.conf.d/head
    and running
    resolvconf -u,
    curl https://registry-1.docker.io/v2/
    still results in
    {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}
    but docker image was successfully pulled.

  8. vito commented on Jul 15, 2016

    @vito
    Contributor

    Merging into #374

  9. added a commit that references this issue on Aug 17, 2016
  10. Joon commented on Mar 28, 2017

    @Joon

    For the benefit of anyone else using a Windows 10 machine outside of a corporate network (like I am)

    I got this same Timeout exceeded while waiting for headers error message after a fresh default install of docker for Windows.

    I had to change the Docker DNS server as per the troubleshooting links on the docker for windows troubleshooting page

    Changing the DNS to the google DNS server fixed the problem for my setup

  11. friendly-shaowei commented on Dec 16, 2017

    @friendly-shaowei

    I met this issue when trying to get http response on docker container.

    Then I change the file "/cat/resolv.conf",content:
    nameserver 114.114.114.114
    nameserver 8.8.8.8

    Finally,it fixed my problem.May be it can help you~

  12. lxjlxk commented on Aug 3, 2022

    @lxjlxk

    nameserver 114.114.114.114
    nameserver 8.8.8.8

    有用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions