Skip to content

/opt/resource/check failed to ping registry: 2 error(s) occurred #347

Closed

Description

@ernado

I'm trying to run "Hello world!" example with "Standalone Binaries". It fails with strange errors:
screenshot from 2016-04-01 18-56-38

Some logs that may help:

uname -a
Linux nexus 4.4.0-16-generic #32-Ubuntu SMP Thu Mar 24 22:38:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[Unit]
Description=Concourse worker
After=network.target

[Service]
ExecStart=/bin/concourse worker --tsa-public-key host_key.pub --tsa-worker-private-key worker_key --work-dir /opt/concourse/worker
Type=simple
RestartSec=3s
Restart=always
WorkingDirectory=/opt/concourse/worker

[Install]
WantedBy=multi-user.target
say-hello
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: dial tcp: lookup registry-1.docker.io on 127.0.2.1:53: read udp 127.0.0.1:33435->127.0.2.1:53: read: connection refused
* ping http: Get http://registry-1.docker.io/v2: dial tcp: lookup registry-1.docker.io on 127.0.2.1:53: read udp 127.0.0.1:40087->127.0.2.1:53: read: connection refused
-- The start-up result is done.
Apr 01 18:37:55 nexus concourse[29079]: {"timestamp":"1459525075.569760084","source":"baggageclaim","message":"baggageclaim.listening","log_level":1,"data":{"addr":"0.0.0.0:7788"}}
Apr 01 18:37:55 nexus concourse[29079]: {"timestamp":"1459525075.588144064","source":"garden-linux","message":"garden-linux.failed-to-parse-pool-state","log_level":2,"data":{"error":"openning state file: open /opt/concourse/worker/linux/state/port_pool.json: no such file or directory"}}
Apr 01 18:37:55 nexus concourse[29079]: {"timestamp":"1459525075.591316700","source":"tsa","message":"tsa.connection.forward-worker.register.start","log_level":1,"data":{"session":"4.1.4","worker-address":"127.0.0.1:35264","worker-platform":"linux","worker-tags":""}}
Apr 01 18:37:55 nexus concourse[29079]: 2016/04/01 18:37:55 failed to forward remote connection: dial tcp 0.0.0.0:7777: getsockopt: connection refused
Apr 01 18:37:55 nexus concourse[29079]: {"timestamp":"1459525075.591898680","source":"tsa","message":"tsa.connection.forward-worker.register.failed-to-fetch-containers","log_level":2,"data":{"error":"Get http://api/containers: EOF","session":"4.1.4"}}
Apr 01 18:37:55 nexus concourse[29079]: {"timestamp":"1459525075.591985941","source":"garden-linux","message":"garden-linux.retain.starting","log_level":1,"data":{"session":"10"}}
Apr 01 18:37:55 nexus concourse[29079]: {"timestamp":"1459525075.592156172","source":"garden-linux","message":"garden-linux.retain.retained","log_level":1,"data":{"session":"10"}}
Apr 01 18:37:55 nexus concourse[29079]: {"timestamp":"1459525075.591971874","source":"tsa","message":"tsa.connection.forward-worker.register.done","log_level":1,"data":{"session":"4.1.4","worker-address":"127.0.0.1:35264","worker-platform":"linux","worker-tags":""}}
Apr 01 18:37:55 nexus concourse[29079]: {"timestamp":"1459525075.766176224","source":"garden-linux","message":"garden-linux.pool.restore.subnet-pool.release.new-allocated","log_level":1,"data":{"allocated-ips":["10.254.0.2"],"id":"ga33g4g3nd3","session":"8.1.1.1","subnet":"10.254.0.0/30"}}
Apr 01 18:37:55 nexus concourse[29079]: {"timestamp":"1459525075.810664415","source":"garden-linux","message":"garden-linux.container.restore.restored","log_level":1,"data":{"handle":"ga33g4g3nd3","session":"14.1"}}
Apr 01 18:37:55 nexus concourse[29079]: {"timestamp":"1459525075.811105728","source":"garden-linux","message":"garden-linux.pool.restore.subnet-pool.release.new-allocated","log_level":1,"data":{"allocated-ips":["10.254.0.6"],"id":"ga33g4g3nd4","session":"8.2.1.1","subnet":"10.254.0.4/30"}}
Apr 01 18:37:55 nexus concourse[29079]: {"timestamp":"1459525075.853553295","source":"garden-linux","message":"garden-linux.container.restore.restored","log_level":1,"data":{"handle":"ga33g4g3nd4","session":"16.1"}}
Apr 01 18:37:55 nexus concourse[29079]: {"timestamp":"1459525075.853964090","source":"garden-linux","message":"garden-linux.pool.restore.subnet-pool.release.new-allocated","log_level":1,"data":{"allocated-ips":["10.254.0.10"],"id":"ga5861ul42c","session":"8.3.1.1","subnet":"10.254.0.8/30"}}
Apr 01 18:37:55 nexus concourse[29079]: {"timestamp":"1459525075.900469542","source":"garden-linux","message":"garden-linux.container.restore.restored","log_level":1,"data": }
// ...
Apr 01 18:48:28 nexus concourse[29079]: {"timestamp":"1459525708.674717903","source":"garden-linux","message":"garden-linux.pool.acquire.creating","log_level":1,"data":{"handle":"ga6ab3n6gua","session":"8.4"}}
Apr 01 18:48:28 nexus concourse[29079]: {"timestamp":"1459525708.674797535","source":"garden-linux","message":"garden-linux.pool.acquire.subnet-pool.acquire.subnet-selecting","log_level":1,"data":{"allocated-subnets":["10.254.0.0/30","10.254.0.4/30","10.254.0.8/30"],"handle":"ga6ab3n6gua","session":"8.4.1.1"}}
Apr 01 18:48:28 nexus concourse[29079]: {"timestamp":"1459525708.674864531","source":"garden-linux","message":"garden-linux.pool.acquire.subnet-pool.acquire.subnet-selected","log_level":1,"data":{"handle":"ga6ab3n6gua","session":"8.4.1.1","subnet":"10.254.0.12/30"}}
Apr 01 18:48:28 nexus concourse[29079]: {"timestamp":"1459525708.674902439","source":"garden-linux","message":"garden-linux.pool.acquire.subnet-pool.acquire.ip-selecting","log_level":1,"data":{"allocated-ips":null,"handle":"ga6ab3n6gua","session":"8.4.1.1"}}
Apr 01 18:48:28 nexus concourse[29079]: {"timestamp":"1459525708.674956083","source":"garden-linux","message":"garden-linux.pool.acquire.subnet-pool.acquire.ip-selected","log_level":1,"data":{"handle":"ga6ab3n6gua","ip":"10.254.0.14","session":"8.4.1.1"}}
Apr 01 18:48:28 nexus concourse[29079]: {"timestamp":"1459525708.674999714","source":"garden-linux","message":"garden-linux.pool.acquire.subnet-pool.acquire.new-allocated","log_level":1,"data":{"allocated-ips":["10.254.0.14"],"handle":"ga6ab3n6gua","session":"8.4.1.1"}}
Apr 01 18:48:28 nexus concourse[29079]: {"timestamp":"1459525708.675029993","source":"garden-linux","message":"garden-linux.pool.acquire.acquired-pool-resources","log_level":1,"data":{"handle":"ga6ab3n6gua","session":"8.4"}}
Apr 01 18:48:28 nexus concourse[29079]: {"timestamp":"1459525708.675055027","source":"garden-linux","message":"garden-linux.pool.acquire.running-graph-cleanup","log_level":1,"data":{"handle":"ga6ab3n6gua","session":"8.4"}}
Apr 01 18:48:28 nexus concourse[29079]: {"timestamp":"1459525708.675087929","source":"garden-linux","message":"garden-linux.pool.acquire.gc.start","log_level":1,"data":{"handle":"ga6ab3n6gua","session":"8.4.2"}}
Apr 01 18:48:29 nexus concourse[29079]: {"timestamp":"1459525709.341547012","source":"garden-linux","message":"garden-linux.pool.acquire.created","log_level":1,"data":{"handle":"ga6ab3n6gua","session":"8.4"}}
Apr 01 18:48:29 nexus concourse[29079]: {"timestamp":"1459525709.581398487","source":"garden-linux","message":"garden-linux.garden-server.create.created","log_level":1,"data":{"request":{"Handle":"","GraceTime":0,"RootFSPath":"/opt/concourse/worker/linux/resource-images/docker-image","BindMounts":null,"Network":"","Privileged":true,"Limits":{"bandwidth_limits":{},"cpu_limits":{},"disk_limits":{},"memory_limits":{}}},"session":"11.23"}}
Apr 01 18:48:29 nexus concourse[29079]: {"timestamp":"1459525709.596529722","source":"garden-linux","message":"garden-linux.garden-server.get-properties.got-properties","log_level":1,"data":{"handle":"ga6ab3n6gua","session":"11.25"}}
Apr 01 18:48:29 nexus concourse[29079]: {"timestamp":"1459525709.598648787","source":"garden-linux","message":"garden-linux.container.next pid","log_level":1,"data":{"handle":"ga6ab3n6gua","pid":1,"session":"22"}}
Apr 01 18:48:29 nexus concourse[29079]: {"timestamp":"1459525709.608063698","source":"garden-linux","message":"garden-linux.garden-server.run.spawned","log_level":1,"data":{"handle":"ga6ab3n6gua","id":"1","session":"11.26","spec":{"Path":"/opt/resource/check","Dir":"","User":"root","Limits":{},"TTY":null}}}
Apr 01 18:48:57 nexus concourse[29079]: {"timestamp":"1459525737.020558834","source":"tsa","message":"tsa.connection.forward-worker.heartbeat.start","log_level":1,"data":{"session":"4.1.27","worker-address":"127.0.0.1:35264","worker-platform":"linux","worker-tags":""}}
Apr 01 18:48:57 nexus concourse[29079]: {"timestamp":"1459525737.022392988","source":"tsa","message":"tsa.connection.forward-worker.heartbeat.reached-worker","log_level":0,"data":{"session":"4.1.27","took":"1.663044ms"}}
Apr 01 18:48:57 nexus concourse[29079]: {"timestamp":"1459525737.033593178","source":"tsa","message":"tsa.connection.forward-worker.heartbeat.done","log_level":1,"data":{"session":"4.1.27","worker-address":"127.0.0.1:35264","worker-platform":"linux","worker-tags":""}}
Apr 01 18:49:27 nexus concourse[29079]: {"timestamp":"1459525767.033954620","source":"tsa","message":"tsa.connection.forward-worker.heartbeat.start","log_level":1,"data":{"session":"4.1.28","worker-address":"127.0.0.1:35264","worker-platform":"linux","worker-tags":""}}
Apr 01 18:49:27 nexus concourse[29079]: {"timestamp":"1459525767.036112070","source":"tsa","message":"tsa.connection.forward-worker.heartbeat.reached-worker","log_level":0,"data":{"session":"4.1.28","took":"1.861335ms"}}
Apr 01 18:49:27 nexus concourse[29079]: {"timestamp":"1459525767.054392815","source":"tsa","message":"tsa.connection.forward-worker.heartbeat.done","log_level":1,"data":{"session":"4.1.28","worker-address":"127.0.0.1:35264","worker-platform":"linux","worker-tags":""}}
Apr 01 18:49:31 nexus concourse[29079]: {"timestamp":"1459525771.633763075","source":"garden-linux","message":"garden-linux.garden-server.run.exited","log_level":1,"data":{"handle":"ga6ab3n6gua","id":"1","session":"11.26","status":1}}

Activity

  1. concourse-bot commented on Apr 1, 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:

    • #116780165 /opt/resource/check failed to ping registry: 2 error(s) occurred

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

  2. ernado commented on Apr 1, 2016

    @ernado
    Author
    fly -t lite intercept -j really-cool-pipeline/hello-world
    
    1: build #6, step: say-hello, type: check
    2: build #7, step: say-hello, type: check
    choose a container: 1
    proc_starter: ExecAsUser: system: program 'bash' was not found in $PATH: exec: "bash": executable file not found in $PATH
    
  3. ernado commented on Apr 1, 2016

    @ernado
    Author

    There were an issue with dns server in container. On host machine nslookup works, but in container it errors with "nslookup: can't resolve 'google.com'"
    I've started worker with -- -dnsServer 192.168.1.35, where 192.168.1.35 is host with bind dns server.

  4. aguestuser commented on Apr 11, 2016

    @aguestuser

    @ernado having a similar error with a cluster bosh deployment on AWS. I'd like to try your fix above, but am having trouble following the context. I'm gathering you used hijack to try to run nslookup google.com, which is what pointed you to the DNS error.

    A bit curious why you chose 192.168.1.35 as the argument to the dnsServer flag. What do you mean by " where 192.168.1.35 is host with bind dns server?"

  5. ernado commented on Apr 11, 2016

    @ernado
    Author

    @aguestuser, 192.168.1.35 is my local machine with caching dns, you can try 8.8.8.8

  6. aguestuser commented on Apr 11, 2016

    @aguestuser

    gotcha! trying that now. (deploying to a bosh cluster, so altering that to a instance_groups.jobs.worker.dns_server property in my concourse.yml)

    also curious: how did you generate the verbose logging above? (the bit after -- The start-up result is done.) seems really useful for situations like this!

  7. ernado commented on Apr 11, 2016

    @ernado
    Author

    @aguestuser, it is output of jourlanctl, i'm using systemd to start concourse.
    In couple hours i wll get access to machine with concourse and check if there is some special flags, you can try concourse --help and look for verbose setting.

  8. doejon commented on Jul 14, 2016

    @doejon

    Running into the same issue on a Digitalocean machine...
    Installed binary as described here: https://concourse.ci/binaries.html (1.4.1)
    I already tried setting the DNS lookup to 8.8.8.8 with the above mentioned flags, no success so far.
    Any hints?

    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: dial tcp: lookup registry-1.docker.io on 8.8.4.4:53: read udp 10.254.0.6:56575->8.8.4.4:53: i/o timeout
    * ping http: Get http://registry-1.docker.io/v2: dial tcp: lookup registry-1.docker.io on 8.8.4.4:53: read udp 10.254.0.6:47374->8.8.4.4:53: i/o timeout
    

    uname gives me:
    3.19.0-58-generic #64~14.04.1-Ubuntu SMP Fri Mar 18 19:05:43 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

    Worker-startup:

    sudo concourse worker \
      --work-dir /worklocal/conc \
      --tsa-host 127.0.0.1 \
      --tsa-public-key host_key.pub \
      --tsa-worker-private-key worker_key \
      -- -dnsServer 8.8.8.8 \
      >wk.log &
    
    jobs:
    - name: hello-world
      plan:
      - task: say-hello
        config:
          platform: linux
          image_resource:
            type: docker-image
            source: {repository: ubuntu}
          run:
            path: echo
            args: ["Hello, world!"]
    

    Open ports: 8080, 80, 443, 2222

    Any hints are more than appreciated!
    Cheers
    Korbi

  9. vito commented on Jul 15, 2016

    @vito
    Contributor

    Try passing --garden-dns-server 8.8.8.8 instead of -- -dnsServer 8.8.8.8.

  10. doejon commented on Jul 17, 2016

    @doejon

    ... nope, still the same issue:

    sudo concourse worker \
      --work-dir /worklocal/conc \
      --tsa-host 127.0.0.1 \
      --tsa-public-key host_key.pub \
      --tsa-worker-private-key worker_key \
      --garden-dns-server 8.8.8.8 \
      >wk.log &
    

    I tried using a self-hosted docker repo on the same machine which did work out. Though it would be nice accessing to docker itself as well ;)

  11. doejon commented on Jul 19, 2016

    @doejon

    ...I just encountered when disabling ufw it all works just fine. Though I simply dislike not using ufw ;) Any hints on which ports I have to open to finally get it up and running?

  12. ernado commented on Jul 19, 2016

    @ernado
    Author

    @k0r8i
    Hi! Try 53 port :)

  13. doejon commented on Jul 19, 2016

    @doejon

    Yeha, that's been my first attempt, too, though could not get any valid dns result. I just quickly dumped all ports used by concourse and it seems to me that there's some other ports trying to access docker:

    netstat -nputw | grep concourse
    tcp        0      0 127.0.0.1:57774         127.0.0.1:51561         ESTABLISHED 4846/concourse  
    tcp        0      0 127.0.0.1:34600         127.0.0.1:7777          ESTABLISHED 4850/concourse  
    tcp        0      0 127.0.0.1:37662         127.0.0.1:2222          ESTABLISHED 4850/concourse  
    tcp        0      0 127.0.0.1:51552         127.0.0.1:8080          ESTABLISHED 4846/concourse  
    tcp        0      0 127.0.0.1:57770         127.0.0.1:51561         ESTABLISHED 4846/concourse  
    tcp        0      0 127.0.0.1:34602         127.0.0.1:7777          ESTABLISHED 4850/concourse  
    tcp        0      0 127.0.0.1:34598         127.0.0.1:7777          ESTABLISHED 4850/concourse  
    tcp        0      0 127.0.0.1:34819         127.0.0.1:5432          ESTABLISHED 4846/concourse  
    tcp        0      0 127.0.0.1:35466         127.0.0.1:5432          ESTABLISHED 4846/concourse  
    tcp        0      0 127.0.0.1:35800         127.0.0.1:5432          ESTABLISHED 4846/concourse  
    tcp        0      0 127.0.0.1:57772         127.0.0.1:51561         ESTABLISHED 4846/concourse  
    tcp6       0      0 XXX.XXX.XXX.XXX:8080     92.194.138.224:45892    ESTABLISHED 4846/concourse  
    tcp6       0      0 127.0.0.1:7777          127.0.0.1:34602         ESTABLISHED 4850/concourse  
    tcp6       0      0 127.0.0.1:8080          127.0.0.1:51552         ESTABLISHED 4846/concourse  
    tcp6       0      0 127.0.0.1:7777          127.0.0.1:34598         ESTABLISHED 4850/concourse  
    tcp6       0      0 XXX.XXX.XXX.XXX:8080     92.194.138.224:45894    ESTABLISHED 4846/concourse  
    tcp6       0      0 127.0.0.1:51561         127.0.0.1:57770         ESTABLISHED 4846/concourse  
    tcp6       0      0 127.0.0.1:2222          127.0.0.1:37662         ESTABLISHED 4846/concourse  
    tcp6       0      0 127.0.0.1:51561         127.0.0.1:57774         ESTABLISHED 4846/concourse  
    tcp6       0      0 127.0.0.1:7777          127.0.0.1:34600         ESTABLISHED 4850/concourse  
    tcp6       0      0 XXX.XXX.XXX.XXX:8080     92.194.138.224:45890    ESTABLISHED 4846/concourse  
    tcp6       0      0 127.0.0.1:51561         127.0.0.1:57772         ESTABLISHED 4846/concourse  
    
    53,80,443,8080/tcp         ALLOW       Anywhere
    53/udp                     ALLOW       Anywhere
    53,80,443,8080/tcp (v6)    ALLOW       Anywhere (v6)
    53/udp (v6)                ALLOW       Anywhere (v6)
    
    53,80,443,8080/tcp         ALLOW OUT   Anywhere
    53/udp                     ALLOW OUT   Anywhere
    1024:65535/udp             ALLOW OUT   Anywhere
    53,80,443,8080/tcp (v6)    ALLOW OUT   Anywhere (v6)
    53/udp (v6)                ALLOW OUT   Anywhere (v6)
    1024:65535/udp (v6)        ALLOW OUT   Anywhere (v6)
    

    Outgoing https-requests from concourse are failing, too - curl on the other hand is working just fine.

  14. doejon commented on Jul 21, 2016

    @doejon

    Finally! In case anyone is having trouble configuring UFW: The solution to the problem is to set UFW's forward policy to "ACCEPT" (as described here: https://docs.docker.com/engine/installation/linux/ubuntulinux/#/enable-ufw-forwarding);

    Cheers
    Korbi

  15. ergo commented on Aug 3, 2016

    @ergo

    I seem to be getting this issue with standalone installation, im not running UFW though.

  16. ergo commented on Aug 3, 2016

    @ergo

    I had to add --garden-dns-server 8.8.8.8 to get everything working.

  17. nocquidant commented on Aug 8, 2016

    @nocquidant

    Same issue here using the official docker image... Is there an environment variable in docker-compose.yml which map to garden-dns-derver?

  18. vito commented on Aug 8, 2016

    @vito
    Contributor

    Opened cloudfoundry/guardian#42 which I think would fix most of these.

    @nocquidant All flags are configurable via env vars. See the bottom of https://concourse.ci/docker-repository.html

  19. vito commented on Aug 8, 2016

    @vito
    Contributor

    This issue is not likely to get resolved as it really depends on how each system is set up. I've opened an issue on Guardian for one fixable aspect, but I'm not sure what we can do about the rest (UFW/etc.). Seems like this issue has served its purpose as a Google reference at least, but it's turning into a bit of a dumping ground, so I'm gonna close it.

    For people who find this issue in the future, please open a fresh issue detailing your system setup (including any firewalls, IaaS setups like AWS VPC, and DNS config) and we'll look into why it didn't work out of the box, and update our docs if it's a recurring theme.

  20. ozbillwang commented on Jul 30, 2017

    @ozbillwang

    Get hints from this comments: #347 (comment)

    I restart iptables service.

    service iptables stop
    service iptables start
    

    The problem is fixed.

    If you try everything above and didn't get the problem fixed, try this or reset iptables to default.

  21. marco-m commented on Jan 14, 2018

    @marco-m
    Contributor

    For people coming here, see #1145 since for my understanding it should be the final fix.

  22. added a commit that references this issue on Aug 13, 2019
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