Skip to content

Dual ATC setup cannot register worker #2085

Closed

Description

@troykinsella

Configuration Assistance Request

Note, below, I'm referring to "ATC" and "TSA" interchangeably, as I'm running binaries.

When configuring two ATCs with the --peer-url web command option, I'm getting the following errors when a worker attempts to register or forward.

From atc1 (and also forwarded to worker logs):

{"timestamp":"...","source":"tsa","message":"tsa.connection.channel.forward-worker.register.failed-to-fetch-containers","log_level":2,"data":{"error":"Get http://api/containers: dial tcp <ip-of-atc2>:38775: getsockopt: connection refused","remote":"<ip-of-proxy>:52066","session":"1.1.1.5"}}
{"timestamp":"...","source":"tsa","message":"tsa.connection.channel.forward-worker.register.failed-to-list-volumes","log_level":2,"data":{"error":"Get http://concourse-atc2:33366/volumes: dial tcp <ip-of-atc2>:33366: getsockopt: connection refused","remote":"<ip-of-proxy>:52066","session":"1.1.1.5"}}

Some Facts

  • Using haproxy to round-robin TSAs
  • The two ATCs, the proxy, and workers live in the same private network, each on their own AWS EC2 instance
  • Every *-bind-ip option available to the web and worker commands is set to 0.0.0.0. Not sure if this is necessary, but I'm just trying to open everything up to get things working.
  • The TSAs are listening on the default port: 2222
  • As I am running several separate concourse installations through one proxy instance, differentiated by TSA port number. For example, the proxy listens on port 2224 and forwards to the default 2222 on the TSA host.
  • Host names are mapped correctly according to the above error messages (which show both the host name along with the correct IP)
  • When both ATCs are brought up, peered, and no worker is attempting to register/forward, no errors occur, which I think tells me that the --peer-url values are correct, and the ATCs have access to each other over 8080
  • I can prove that atc1 has connectivity to act2, and vice versa, using telnet to connect and nc to listen on an example ephemeral port from one of the above error messages
  • If relevant, I can prove the same connectivity between the proxy, ATCs/TSAs, and workers in all directions
  • When I remove the --peer-url option and run only one ATC/TSA, the worker is able to register/forward successfully and show up in fly workers, which tells me that proxy config and ssh keys are correct
  • When I remove the proxy from the equation entirely (and again running two ATCs/TSAs, peered), and have the --external-urls point at atc1 (not the proxy), and have the worker point directly at either of the TSAs, the same errors occur (except for the difference in the "remote" value). This suggests that I've done something fundamentally incorrect, as multiple ATCs/TSAs should be providing redundancy so that service is upheld when one is unavailable, but that's not happening.
  • When I run without any proxy and only one ATC/TSA, the worker shows up in fly workers
  • In between changing any concourse command options to perform any of the above tests, I am truncating the workers table
  • The AWS security group associated with every involved EC2 instance grants connectivity over all ports and all protocols, and the subnet CIDRs to which any EC2 instance is member is listed in the source

Relevant Configuration

# Concourse web #1:
--peer-url http://concourse-atc2:8080
--external-url https://<public-host-name-of-proxy>
--tsa-bind-ip 0.0.0.0

# Concourse web #2:
--peer-url http://concourse-atc1:8080
--external-url https://<public-host-name-of-proxy>
--tsa-bind-ip 0.0.0.0

# Worker:
--tsa-host <internal-host-name-of-proxy>
--tsa-port 2224 
--bind-ip 0.0.0.0
--garden-bind-ip 0.0.0.0
--baggageclaim-bind-ip 0.0.0.0

# Proxy config for TSAs:
frontend concourse-tsa *:2224
	mode tcp
	option tcplog
	default_backend concourse-tsa-pool
backend concourse-tsa-pool
	mode tcp
	option tcplog
	balance	roundrobin
	server concourse-atc1 concourse-atc1:2222 check
	server concourse-atc2 concourse-atc2:2222 check

Stuff

  • Concourse version: Tried 3.8.0, 3.9.1
  • Deployment type (BOSH/Docker/binary): binary
  • Infrastructure/IaaS: AWS
  • Browser (if applicable): Chromium on Linux
  • Did this used to work? Not for me

Summary

So, given all of this, I'm lead to believe that I've provided adequate connectivity between these concourse parts such that the ATCs/TSAs should be able to talk to each other and allow successful worker registration/forwarding. My wild-guess theory is that I've somehow not configured the ATCs/TSAs correctly such that one ATC/TSA is not listening on the ephemeral port for querying/manipulating containers and volumes when the other is trying to connect. Or, I've gotten confused from a number of id10t errors.

I'd appreciate some guidance. What might I have done wrong given these clues?

Activity

  1. avanier commented on Mar 12, 2018

    @avanier
    Contributor

    I've struggled with this quite a bit with this and gave up. I have nothing constructive to add, but I'm out there cheering.

  2. xtremerui commented on May 4, 2018

    @xtremerui
    Contributor

    Hi @troykinsella , when you do

    When I run without any proxy and only one ATC/TSA, the worker shows up in fly workers
    

    did it run with or without --peer-ip? Could you provide the results of both cases?

    Thank you.

  3. neumayer commented on May 25, 2018

    @neumayer

    I am stuck with this as well. As soon as I add a peer-url can't register any longer. So I have the exact same issue as the op. Peer-ip makes no difference, as soon as a peer-url is there workers pick it up to register to it and for some reason can't.

  4. neumayer commented on May 29, 2018

    @neumayer

    Ok, I made this work and it was a long journey:

    Some info to get started:
    Concourse version: Tried 3.13.0
    Deployment type (BOSH/Docker/binary): docker(-compose)
    Infrastructure/IaaS: Oracle Cloud Infrastructure / Oraclelinux7

    First I blamed the cloud load balancer. I managed to get it running with haproxy. The conclusion was: it could still be the cloud load balancer.
    Then I tried to replicate the error on my machine with docker-compose. I could not replicate the error on my machine with docker-compose. So I thought it is unrelated to docker.
    Then I removed the proxy from my experiments. Just having two instances with different peer urls. Turns out it was unrelated to the load balancer.
    Then I tried to circumvent dns in my debugging. It had no effect. So it was unrelated to dns.
    Then as and extra task I removed all http_proxy, https_proxy, and no_proxy settings everywhere. Debugging corporate proxy stuff is the single best thing I know in life. It turns out my problem was unrelated to the http_proxy (hard to believe, I know).
    Then I tried to pinpoint the problem by registering workers in to my machine (from my cloud environment). That worked, so it was unrelated to the worker.
    This brought me to focusing on the web node. Out of desperation I tried running it without docker. And this was related. Somewhat unrelated I experienced the "session signing key crash problem" #2152).
    Then I thought how the cloud docker setup is is different from my local setup. Both are linux, both use docker, both use docker-compose. But only one of them is enterprise linux with an old version of docker and a firewall running. So there you go.

    Without 100 percent pinpointing what was wrong in my case (vaguely either the firewall or how docker changes routing rules in that particular setup), I disabled the firewalls (i.e. firewalld) on the webnodes (before starting docker) and ran docker with network=host for good measure. So it's still possible that either of the following would solve the problem:

    • newer docker version
    • different host linux with different firewall settings
    • enable/disable or start/stop the right services in the right order depending on the previous points

    Now I blame myself for running a bit of a hybrid setup (I have one cloud instance for each web1, web2, and worker nodes) but run them as containers with docker-compose there. The reason for that is that I hope to replace that by some container orchestration in the future instead of writing systemd files and running the binaries directly). In any case this is not related to concourse, it's just a real pain in the neck to debug, there's so many moving parts...

    I don't think anything here is relevant to the op, I just wanted to share my story...

  5. vito commented on Aug 22, 2018

    @vito
    Contributor

    Man, I really appreciate all the troubleshooting and info y'all have given. As far as I can tell it was configured correctly, but it's really hard to get to the bottom of things like this.

    We've at least fleshed out docs here that cover the networking requirements: https://concourse-ci.org/topology.html

    Based on your error messages it sounds like the TSA couldn't reach the ephemeral port (bound on the TSA) for the forwarded workers, but if this is true that should be fine:

    The AWS security group associated with every involved EC2 instance grants connectivity over all ports and all protocols, and the subnet CIDRs to which any EC2 instance is member is listed in the source

    Which is correct given our docs say the web nodes require outbound traffic to...:

    other web nodes (possibly itself) on an ephemeral port when a worker is forwarded through the web node's TSA

    It's been a while since this has been opened, and we haven't really been on point here because...well, there are a lot of moving parts that are difficult to understand from afar. I'm gonna close this and hope that y'all have at least become unblocked in the meantime. If you need more help feel free to ask in the forums or in Discord.

  6. troykinsella commented on Aug 22, 2018

    @troykinsella
    ContributorAuthor

    I haven't had an opportunity to pick this up since I submitted, but I wouldn't say it was a blocker for us being that Concourse stability has sky-rocketed in recent-ish versions. One ATC has been ample for us for a long time.
    Thanks, Alex and all, for an amazing tool!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions