Answers: <p>Could you please try the commands above between all hosts ?</p>
  
  <p>INSIDE HOST A: </p>
  
  <pre><code>nc -zv HOST_B_IP_ADDRESS 2377,4789,7946
  nc -zv HOST_C_IP_ADDRESS 2377,4789,7946
  </code></pre>
  
  <p>INSIDE HOST B: </p>
  
  <pre><code>nc -zv HOST_A_IP_ADDRESS 2377,4789,7946
  nc -zv HOST_C_IP_ADDRESS 2377,4789,7946
  </code></pre>
  
  <p>INSIDE HOST C: </p>
  
  <pre><code>nc -zv HOST_A_IP_ADDRESS 2377,4789,7946
  nc -zv HOST_B_IP_ADDRESS 2377,4789,7946
  </code></pre>
  
  <p>As explained in <a href="https://docs.docker.com/engine/swarm/swarm-tutorial/#open-protocols-and-ports-between-the-hosts" rel="nofollow noreferrer">https://docs.docker.com/engine/swarm/swarm-tutorial/#open-protocols-and-ports-between-the-hosts</a>, some ports must be available between hosts in order for Docker Swarm to work correctly.</p>
  
  <p>The error reported sounds like a port related problem. 
  Maybe is there another application in one of these hosts already using one of the ports needed by Docker ? Maybe a firewall configuration ?</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-09-13T09:49:59.267Z
Answers: So your command says "invalid port" so I tried nmap with these ports - see update above.
Answers: Ta Mu
Answers: CC BY-SA 3.0
Answers: 2017-09-12T15:02:15.730Z
Answers: 2017-09-12T15:02:15.730Z
Answers: Felipe de Macêdo
Body: <p>Consider the following setup:</p>
  
  <p>Three hosts in the same network:</p>
  
  <ul>
  <li>Host A - SLES </li>
  <li>Host B - Ubuntu</li>
  <li>Host C - Ubuntu</li>
  </ul>
  
  <p>Then, the following has worked:</p>
  
  <ul>
  <li>Init swarm on A</li>
  <li>Join swarm at B, make B a manager</li>
  </ul>
  
  <p>The following is however not working:</p>
  
  <ul>
  <li>Join swarm at C as worker with token issued from A</li>
  <li>Join swarm at C as worker with token issued from B</li>
  </ul>
  
  <p>In both cases we get the same error:</p>
  
  <pre><code>Error response from daemon: could not find local IP address: 
  dial udp: address udp/2377​: unknown port
  </code></pre>
  
  <p>Honestly, I have even no idea how to interpret this message.</p>
  
  <p>Any ideas?..</p>
  
  <p>UPD. nmap results for ports 2377,4789,7946 (hint from Felipe in a comment below) - no idea what are they good for but now it is clear that something is wrong with host C. </p>
  
  <p><strong>Host A</strong> (Primary manager)</p>
  
  <pre><code>PORT     STATE  SERVICE
  2377/tcp open   unknown
  4789/tcp closed unknown
  7946/tcp open   unknown
  </code></pre>
  
  <p><strong>Host B</strong> (Secondary manager)</p>
  
  <pre><code>PORT     STATE  SERVICE
  2377/tcp open   unknown
  4789/tcp closed unknown
  7946/tcp open   unknown
  </code></pre>
  
  <p><strong>Host C</strong> (should become a worker)</p>
  
  <pre><code>PORT     STATE  SERVICE
  2377/tcp closed unknown
  4789/tcp closed unknown
  7946/tcp closed unknown
  </code></pre>
  
  <p><strong>Host D</strong> (successfully added as a worker)</p>
  
  <pre><code>PORT     STATE  SERVICE
  2377/tcp closed unknown
  4789/tcp closed unknown
  7946/tcp open   unknown
  </code></pre>
  
  <p>Finally, with host B there is the actual problem.</p>
  
  <ul>
  <li>swarm init => OK; port 2377 is open</li>
  <li>swarm leave => port is closed again</li>
  <li>swarm join => error "port not found"</li>
  </ul>
  
Comments: CC BY-SA 3.0
Comments: 2017-09-09T07:11:23.820Z
Comments: UPD https://github.com/moby/moby/issues/34794
Comments: Ta Mu
Comments: CC BY-SA 3.0
Comments: 2017-09-11T12:42:24.373Z
Comments: Maybe if you share the commands you have used, like - (...) docker swarm init --advertise-addr x.x.x.x (...) - (...) docker swarm join (...) We might have a clue. Maybe the ports configurations for host C are wrong ?
Comments: Felipe de Macêdo
Comments: CC BY-SA 3.0
Comments: 2017-09-11T17:37:57.390Z
Comments: the command is exactly same copy-paste which is issued by docker itself on "docker swarm join-token worker"
Comments: Ta Mu
Comments: CC BY-SA 4.0
Comments: 2019-04-19T20:49:22.003Z
Comments: @Peter did you find a solution?
Comments: user3731622
Tags: <docker><docker-swarm><networking>
Title: Docker daemon error on joining swarm node - could not find local IP address - unknown port
UserDisplayName: Ta Mu
ThreadText: # Docker daemon error on joining swarm node - could not find local IP address - unknown port
  
  (Asked by: username_0 on 2017-09-08)
  
  Consider the following setup:
  
  Three hosts in the same network:
  
  * Host A - SLES
  * Host B - Ubuntu
  * Host C - Ubuntu
  
  Then, the following has worked:
  
  * Init swarm on A
  * Join swarm at B, make B a manager
  
  The following is however not working:
  
  * Join swarm at C as worker with token issued from A
  * Join swarm at C as worker with token issued from B
  
  In both cases we get the same error:
  
  ```
  Error response from daemon: could not find local IP address: 
  dial udp: address udp/2377​: unknown port
  
  ```
  
  Honestly, I have even no idea how to interpret this message.
  
  Any ideas?..
  
  UPD. nmap results for ports 2377,4789,7946 (hint from username_1 in a comment below) - no idea what are they good for but now it is clear that something is wrong with host C.
  
  **Host A** (Primary manager)
  
  ```
  PORT     STATE  SERVICE
  2377/tcp open   unknown
  4789/tcp closed unknown
  7946/tcp open   unknown
  
  ```
  
  **Host B** (Secondary manager)
  
  ```
  PORT     STATE  SERVICE
  2377/tcp open   unknown
  4789/tcp closed unknown
  7946/tcp open   unknown
  
  ```
  
  **Host C** (should become a worker)
  
  ```
  PORT     STATE  SERVICE
  2377/tcp closed unknown
  4789/tcp closed unknown
  7946/tcp closed unknown
  
  ```
  
  **Host D** (successfully added as a worker)
  
  ```
  PORT     STATE  SERVICE
  2377/tcp closed unknown
  4789/tcp closed unknown
  7946/tcp open   unknown
  
  ```
  
  Finally, with host B there is the actual problem.
  
  * swarm init => OK; port 2377 is open
  * swarm leave => port is closed again
  * swarm join => error "port not found"
  
  **Tags:** docker, docker-swarm, networking
  
  > **Comments:**
  > **username_0**: UPD https://github.com/moby/moby/issues/34794  
  > **username_1**: Maybe if you share the commands you have used, like - (...) docker swarm init --advertise-addr x.x.x.x (...) - (...) docker swarm join (...) We might have a clue. Maybe the ports configurations for host C are wrong ?  
  > **username_0**: the command is exactly same copy-paste which is issued by docker itself on "docker swarm join-token worker"  
  > **username_2**: @Peter did you find a solution?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-09-12. Score: 1
  
  Could you please try the commands above between all hosts ?
  
  INSIDE HOST A:
  
  ```
  nc -zv HOST_B_IP_ADDRESS 2377,4789,7946
  nc -zv HOST_C_IP_ADDRESS 2377,4789,7946
  
  ```
  
  INSIDE HOST B:
  
  ```
  nc -zv HOST_A_IP_ADDRESS 2377,4789,7946
  nc -zv HOST_C_IP_ADDRESS 2377,4789,7946
  
  ```
  
  INSIDE HOST C:
  
  ```
  nc -zv HOST_A_IP_ADDRESS 2377,4789,7946
  nc -zv HOST_B_IP_ADDRESS 2377,4789,7946
  
  ```
  
  As explained in <https://docs.docker.com/engine/swarm/swarm-tutorial/#open-protocols-and-ports-between-the-hosts>, some ports must be available between hosts in order for Docker Swarm to work correctly.
  
  The error reported sounds like a port related problem.
  Maybe is there another application in one of these hosts already using one of the ports needed by Docker ? Maybe a firewall configuration ?
  
  > **Comments:**
  > **username_0**: So your command says "invalid port" so I tried nmap with these ports - see update above.  
  
  ---
  
  