Docker Community Forums

Share and learn in the Docker community.

Error response from daemon: rpc error: code = Unavailable desc = grpc: the connection is unavailable

Hi all,

I would like to create a node and link the node that is addressed with its own IP address with another node which also has its own IP address.

What I did was:

IP address ending with “101” is the manager1.
IP address ending with “103” is the manager2.

docker swarm join \
>     --token SWMTKN-1-498jdoqw7ne0nvcv6tcpajt7p4osuja6agni9e8kr2f1w2knys-2uxv6jhobs8f0t6lkrwnmsus3 \
>     XXX.XXX.XX.101:2377 \
>     --listen-addr XXX.XXX.XX.103:2377

As a result my output was:

Error response from daemon: rpc error: code = Unavailable desc = grpc: the connection is unavailable

What I would like to do is:

root@ubuntu:~# docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
q8qrlm9jt5xc9usb0mm2rnjjd * manager2 Ready Active Leader

Add another node under the manager2, well what I’ve done is probably a mess.

Is there a for me to correct this mistake or rather add another node using:

docker swarm init …
docker swarm run …
etc. ?

I hope my message was clear for everyone :confused:

If not please let me know what you don’t understand from my set of instructions.

Kind Regards,

Doga

I am getting this as well as of 2017.09.

Reverting to 2007.06.* fixes the situation.

Interestingly, when I run dockerd on the worker in the foreground, it does not have a problem joining the swarm. However, when started via “systemctl start docker” on centos, the worker is unable to join the swarm.

Hey @if6was9 ,

same problem here. Did you solved it?
I am using Ubuntu 16.04 LTS, Kernel 14.10.0-35.
docker-ce 17.06.2-ce

Already tried to flush iptables etc. without success.

Another guy at our company is using a mix of debian stretch and ubuntu docker hosts(vms) and he is fine with the newest docker-ce.

Thanks and have a nice weekend all
Timo

Fixed!

related to: https://github.com/moby/moby/issues/34825#issuecomment-331100937 and https://github.com/grpc/grpc-go/commit/955c867061e3b1a5b8f6f07d1efcf1b69af043d8 I have had configured a company proxy in

/etc/systemd/system/docker/http-proxy.conf

after removing this config, all 17.09 docker versions will join the swarm properly.

Hi ,

I faced same issue. Error response from daemon: rpc error: code = Unavailable desc = grpc: the connection is unavailable .

In my case , Iptables caused the issue. I stopped the iptables service to resolve this issue.

2 Likes

Thanks for posting this.

Looks like the upstream issues are a bit of a mess…we can live without proxy access.

Temporary solved by flushing iptables, but was a bad idea!! After that, cloning images didn’t work because it didn’t find the appropriate iptables chain “docker”.

It is indeed a FW issue, but more precisely firewalld (centos7).
Solved the issue by allowing the appropriate ports through firewalld,:

sudo firewall-cmd --add-port=2376/tcp --permanent  
sudo firewall-cmd --add-port=2377/tcp --permanent  
sudo firewall-cmd --add-port=7946/tcp --permanent  
sudo firewall-cmd --add-port=7946/udp --permanent  
sudo firewall-cmd --add-port=4789/udp --permanent
2 Likes

I got the exact same error, and finally found out I was being too smart. Below is my output from the init command, so make sure you just copy the bold line. I was changing the ip address to another vm2.

$ docker-machine ssh myvm1 “docker swarm init --advertise-addr 192.168.99.101”
Swarm initialized: current node (o7egg259g3bjibx5cubiaiu5h) is now a manager.

To add a worker to this swarm, run the following command:

**docker swarm join --token SWMTKN-1-1h201mpziax5vx5qud8e5sxbcejp1durmeiwj4hsbsx0koagv8-8lqloy869v38sdd8x7dbziimi 192.168.99.101:2377**

To add a manager to this swarm, run ‘docker swarm join-token manager’ and follow the instructions.

1 Like

the firewall commands you listed worked a treat for me.

Yep, as you said, it is a firewall issue

I was facing same issue .
I created 2 machines
centos-1 running docker - Version: 17.12.0-ce
centos-2 running docker - Version: 17.12.0-ce
i made centos-1 as master / manager node . I was trying to make centos-2 as worker node but it was failing with same error .
So i stopped the firewall with #iptables -F command and then restarted docker daemon by stsremctl restart docker .
Post which my problem was resolved and it

[root@centos2 ~]# docker swarm join --token SWMTKN-1-4026x0nvco9tkxk8zrxu9khal33g3mlhvgba1tfinl5i73yur1-7yihj163dq62sn8hhvw6iv6gr 192.168.56.105:2377
This node joined a swarm as a worker.

I did the same mistake! Thanks for pointing it out!

This was also a firewall issue for me. On Ubuntu 18.04:

sudo ufw enable
sudo ufw allow 2376
sudo ufw allow 2377
sudo ufw allow 7946
sudo ufw allow 4789

These rules will be stored permanently in a file called user.rules which can be found using locate user.rules. Mine was in /etc/ufw/user.rules.

Solved
I was having this problem in centos 8.

Just disable the firewall.

systemctl stop firewalld

I’d say it’s possibly firewall related. Ensure your ports are configured correctly on the third box. From the Docker docs:

Open protocols and ports between the hosts The following ports must be available. On some systems, these ports are open by default.

TCP port 2377 for cluster management communications TCP and UDP port 7946 for communication among nodes UDP port 4789 for overlay network traffic