moby: Error response from daemon: can't initialize raft node: rpc error: code = 2 desc = could not connect to prospective new cluster member using its advertised address: rpc error: code = 14 desc = grpc: the connection is unavailable

Description

Steps to reproduce the issue: 1. 2. 3.

Describe the results you received:

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

(paste your output here)

Output of docker info:

(paste your output here)

Additional environment details (AWS, VirtualBox, physical, etc.):

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 23 (7 by maintainers)

Most upvoted comments

It looks like you’re running the CS (commercially supported) version of Docker with UCP; if you have a support contract, it’s best to contact support directly

I found a workaround after disabling firewall didn’t work: Join the node as a worker, then promote to manager (for some reason worker does not get the same error)

Sounds like a connectivity issue between those machines / laptops. Think of;

  • firewalls being set on those machines
  • swarm mode does not support dynamic IP-addresses, so if the IP-address of one of the laptops changes, the swarm may no longer function.
  • are the ubuntu and debian machines running bare metal, or is docker running inside a VM?

I suspect this is an issue with the setup, not a bug

@christoph-hipp The meat of the error is this:

could not connect to prospective new cluster member using its advertised address

And

the connection is unavailable

This would appear to mean that the new member is not accessible via the address defined in --advertise-addr passed in via docker swarm join. If you didn’t pass in a --advertise-addr then you may need to.

I have found a solution for this error in my platform. The ports was available in tcp and udp the telnet and the netcat was ok. The problem was with the proxy. I have added the IP of each nodes in the NO_PROXY value for docker and all is OK.

the workaround about this issue:

  1. mark out the proxy from the docker proxy define file /etc/systemd/system/docker.service.d/docker.conf or /etc/systemd/system/docker.service.d/docker_proxy.conf
  2. reload the deamon with " systemctl daemon-reload "
  3. Re-excute the command "docker swarm join --token xxxx manageip " , if there are more than one ip , you should plus “–advertise-addr + IP”

i have problem with similar error.

i have two nodes behind hardware firewall. nodes has local network.

  1. node A - 192.168.100.2
  2. node B - 192.168.100.3

lets init manager on A

docker swarm init --listen-addr=192.168.100.2

all is ok. lets gets mager join token

docker swarm join-token manager

then run join on B

docker swarm join --token TOKEN 192.168.100.2

Error response from daemon: manager stopped: 
can't initialize raft node: rpc error: code = Unknown desc = could not connect to prospective new cluster member 
using its advertised address: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, 
latest connection error: connection error: 
desc = "transport: Error while dialing dial tcp 192.168.100.1:2377: connect: connection refused"

by this word can't initialize raft node i found this discussion.

and my problem solves this reciept: add --advertise-addr https://github.com/moby/moby/issues/32992#issuecomment-309424619 thanks @cpuguy83 !

then i run on B

docker swarm join --advertise-addr 192.168.100.3 --token TOKEN 192.168.100.2

and all is ok now

This node joined a swarm as a manager.

as i understand, the 2377 port was opened only inside local network. and without --advertise-addr param, docker try to reach node A with wrong way (throuth its public ip or some thing like this) and gets bloced by firewall.

Hope, it will be userfull. Cheers.

I have been looking all around the documentation and found the problem, it looks like swarm mode is available on mac but only as single node. This comes from FAQS

Can I use Docker for Mac with new swarm mode? Yes, you can use Docker for Mac to test single-node features of swarm mode introduced with Docker Engine 1.12, including initializing a swarm with a single node, creating services, and scaling services. Docker “Moby” on Hyperkit will serve as the single swarm node. You can also use Docker Machine, which comes with Docker for Mac, to create and experiment a multi-node swarm. Check out the tutorial at Get started with swarm mode.

Thanks a lot for your help @thaJeztah