Stuck with Docker swarm join error response from daemon? We can help you.
At times our customers report to us that they receive this error while using docker swarm/service commands.
Here at Bobcares, we often handle requests from our customers to fix similar errors as a part of our Server Management Services.
Today we will see how our Support Engineers fix this for our customers.
How to fix Docker swarm join error response from daemon
We will see how this error looks like along with the steps that our Support Engineers follow to fix this error.
At times we may notice that all docker swarm/service commands fail to execute, and they return this error.
Following is an example for docker swarm command getting the error message in return:
$ docker swarm join-token manager
Error response from daemon: rpc error: code = 4 desc = context deadline exceeded
However, we may also notice that while executing normal docker commands such as docker ps/docker images, etc., we will not be getting this error.
Cause Analysis from the logs:
Now we will check the logs to see if we can conclude the cause of this error from it.
We can view docker’s log using the following command:
$ sudo tail -f /var/log/messages | grep docker
Note: We must keep in mind that in Linux distributions, the docker log location is inconsistent; the above command is a Redhat’s approach.
Upon checking the logs we will be able to see the following:
1. dockerd: time="2019-04-18T11:58:16.371148755+08:00" level=debug msg="miss notification: dest IP 10.0.0.4, dest MAC "
2. dockerd: time="2019-04-18T11:58:16.373118682+08:00" level=debug msg="miss notification: dest IP 10.0.0.8, dest MAC "
3. dockerd: time="2019-04-18T11:58:16.780678187+08:00" level=error msg="agent: session failed" error="session initiation timed out" module="node/agent" node.id=271z2mmy2mqqxe2msysm72q2s
4. dockerd: time="2019-04-18T11:58:16.780713226+08:00" level=debug msg="agent: rebuild session" module="node/agent" node.id=271z2mmy2mqqxe2msysm72q2s
5. dockerd: time="2019-04-18T11:58:17.371118179+08:00" level=debug msg="miss notification: dest IP 10.0.0.6, dest MAC "
6. dockerd: time="2019-04-18T11:58:17.373148037+08:00" level=debug msg="miss notification: dest IP 10.0.0.4, dest MAC "
7. dockerd: time="2019-04-18T11:58:18.371017818+08:00" level=debug msg="miss notification: dest IP 10.0.0.8, dest MAC "
8. dockerd: time="2019-04-18T11:58:18.373146453+08:00" level=debug msg="miss notification: dest IP 10.0.0.6, dest MAC "
9. dockerd: time="2019-04-18T11:58:18.643814757+08:00" level=info msg="3a81dc09ea33b88e is starting a new election at term 812" module=raft node.id=271z2mmy2mqqxe2msysm72q2s
10. dockerd: time="2019-04-18T11:58:18.643848592+08:00" level=info msg="3a81dc09ea33b88e became candidate at term 813" module=raft node.id=271z2mmy2mqqxe2msysm72q2s
11. dockerd: time="2019-04-18T11:58:18.643865419+08:00" level=info msg="3a81dc09ea33b88e received MsgVoteResp from 3a81dc09ea33b88e at term 813" module=raft node.id=271z2mmy2mqqxe2msysm72q2s
12. dockerd: time="2019-04-18T11:58:18.643899515+08:00" level=info msg="3a81dc09ea33b88e [logterm: 2, index: 141] sent MsgVote request to 8be3f17aae7108e at term 813" module=raft node.id=271z2mmy2mqqxe2msysm72q2s
13. dockerd: time="2019-04-18T11:58:18.645083884+08:00" level=debug msg="failed to send message MsgVote" error="rpc error: code = 13 desc = connection error: desc = \"transport: x509: certificate has expired or is not yet valid\"" peer_id=8be3f17aae7108e
14. dockerd: time="2019-04-18T11:58:19.371110322+08:00" level=debug msg="miss notification: dest IP 10.0.0.8, dest MAC "
15. dockerd: time="2019-04-18T11:58:19.371435727+08:00" level=debug msg="miss notification: dest IP 10.0.0.4, dest MAC "
From the logs, we can infer that the swarm cluster environment communication has encountered a problem.
Step to fix this error:
By Reinitializing the cluster environment we will be able to fix this error.
With the following step we can do this:
$ docker swarm init --force-new-cluster
After executing this command the issue will be resolved.
[Need assistance? We can help you]
Conclusion
To conclude, we saw the steps that our Support Techs follow to fix this Docker error.
0 Comments