[x] I searched existing issues before opening this one
Expected behavior
Docker resolves container by it's service name explicitly to 1 ip address, for example I have one docker swarm service redis with only one container created for it.
I can access to this redis container from inside other containers attached to common network using service name:
62d54058d345:/data# ping redis
PING redis (10.0.2.5): 56 data bytes
64 bytes from 10.0.2.5: seq=0 ttl=64 time=0.126 ms
64 bytes from 10.0.2.5: seq=1 ttl=64 time=0.110 ms
^C
--- redis ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.110/0.118/0.126 ms
Actual behavior
Docker sometimes resolves redis name to some unknown ghost ip, this looks like that:
62d54058d345:/data# ping redis
PING redis (10.0.2.5): 56 data bytes
64 bytes from 10.0.2.5: seq=0 ttl=64 time=0.126 ms
64 bytes from 10.0.2.5: seq=1 ttl=64 time=0.110 ms
^C
--- redis ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.110/0.118/0.126 ms
# this is right container ip = 10.0.2.5
62d54058d345:/data# ping redis
PING redis (10.0.2.5): 56 data bytes
64 bytes from 10.0.2.5: seq=0 ttl=64 time=0.100 ms
^C
--- redis ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.100/0.100/0.100 ms
62d54058d345:/data# ping redis
PING redis (10.0.2.5): 56 data bytes
64 bytes from 10.0.2.5: seq=0 ttl=64 time=0.128 ms
^C
--- redis ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.128/0.128/0.128 ms
# this is right container ip = 10.0.2.5
62d54058d345:/data# ping redis
PING redis (10.0.2.21): 56 data bytes
64 bytes from 10.0.2.21: seq=0 ttl=64 time=0.100 ms
^C
--- redis ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.100/0.100/0.100 ms
# this is WRONG container ip = 10.0.2.21
62d54058d345:/data# ping redis
PING redis (10.0.2.5): 56 data bytes
64 bytes from 10.0.2.5: seq=0 ttl=64 time=0.090 ms
^C
--- redis ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.090/0.090/0.090 ms
# this is right container ip = 10.0.2.5
62d54058d345:/data# ping redis
PING redis (10.0.2.5): 56 data bytes
64 bytes from 10.0.2.5: seq=0 ttl=64 time=0.153 ms
^C
--- redis ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.153/0.153/0.153 ms
# this is right container ip = 10.0.2.5
62d54058d345:/data# ping redis
PING redis (10.0.2.21): 56 data bytes
64 bytes from 10.0.2.21: seq=0 ttl=64 time=0.121 ms
64 bytes from 10.0.2.21: seq=1 ttl=64 time=0.110 ms
^C
--- redis ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.110/0.115/0.121 ms
# this is WRONG container ip = 10.0.2.21
I have no any containers with ip = 10.0.2.21 in this network:
I also tried to investigate what is this mysterious container should be by port scanning inside out another container in this network:
62d54058d345:/data# nmap -p0-65535 10.0.2.21 -T5
Starting Nmap 7.70 ( https://nmap.org ) at 2019-04-01 12:15 UTC
Warning: 10.0.2.21 giving up on port because retransmission cap hit (2).
Nmap scan report for 10.0.2.21
Host is up (0.00015s latency).
Not shown: 65529 closed ports
PORT STATE SERVICE
16521/tcp filtered unknown
30600/tcp filtered unknown
35885/tcp filtered unknown
50057/tcp filtered unknown
53747/tcp filtered unknown
55251/tcp filtered unknown
58641/tcp filtered unknown
MAC Address: 02:42:0A:00:02:02 (Unknown)
Nmap done: 1 IP address (1 host up) scanned in 180.63 seconds
I did not have any services created by me with such open ports.
Steps to reproduce the behavior
Unknown. I just used Docker Swarm without any problems for months, sometimes upgrade it and so on. Today I discovered that my redis-backup container sometimes can not connect to redis service in another container.
Output of docker version:
andyceo@newhope:~$ sudo docker version
Client:
Version: 18.09.4
API version: 1.39
Go version: go1.10.8
Git commit: d14af54
Built: Wed Mar 27 18:34:51 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.4
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: d14af54
Built: Wed Mar 27 18:01:48 2019
OS/Arch: linux/amd64
Experimental: false
Expected behavior
Docker resolves container by it's service name explicitly to 1 ip address, for example I have one docker swarm service
redis
with only one container created for it.I can access to this
redis
container from inside other containers attached to common network using service name:Actual behavior
Docker sometimes resolves
redis
name to some unknown ghost ip, this looks like that:I have no any containers with ip = 10.0.2.21 in this network:
I also did a list of all containers from all nodes with it's name and ip, it looks like:
I did not find any container with ip = 10.0.2.21 in this list.
I did this list with following command (if that matters):
I also tried to investigate what is this mysterious container should be by port scanning inside out another container in this network:
I did not have any services created by me with such open ports.
Steps to reproduce the behavior
Unknown. I just used Docker Swarm without any problems for months, sometimes upgrade it and so on. Today I discovered that my redis-backup container sometimes can not connect to redis service in another container.
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.)
Nothing to add. All nodes are bare metal hosts, with Ubuntu 16.04 upgraded to latest packages and kernel, with only docker installed.