MongoDb Charts Installation

I am new to MongoDB, docker stuff.
I try to install Mongo Charts, but cannot pass test connections step.
sudo docker run --rm quay.io/mongodb/charts:19.12.1 charts-cli test-connection mongodb://172.17.0.1

I get “MongoNetworkError: connect ECONNREFUSED 172.17.0.1”.
I don’t know what else to check to make this work.

I am using Ubuntu and I have MongoDB installed locally. I can connect using RoboT3, compass etc.

This is my mongod.conf

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1

I can see the 27017 is listening mode

systemd-r    550 systemd-resolve   13u  IPv4   28466      0t0  TCP 127.0.0.53:53 (LISTEN)
dockerd    24044            root   22u  IPv6 2259007      0t0  TCP *:2377 (LISTEN)
dockerd    24044            root   27u  IPv6 2257392      0t0  TCP *:7946 (LISTEN)
cupsd     105733            root    6u  IPv6 2992175      0t0  TCP [::1]:631 (LISTEN)
cupsd     105733            root    7u  IPv4 2992176      0t0  TCP 127.0.0.1:631 (LISTEN)
mongod    115722         mongodb   11u  IPv4 3150950      0t0  TCP 127.0.0.1:27017 (LISTEN)

sudo docker network ls

NETWORK ID          NAME                DRIVER              SCOPE
792044a81858        bridge              bridge              local
8799e71f7cb3        docker_gwbridge     bridge              local
6dbede781330        host                host                local
q2q7irgd4op5        ingress             overlay             swarm
ef873a4216de        none                null                local

sudo docker network inspect bridge

[
    {
        "Name": "bridge",
        "Id": "792044a818585bc4d0793324a9f7e28861f1008e26bb8f70e1b18263be3d1d7f",
        "Created": "2020-03-13T11:31:47.291514454-07:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.17.0.0/16"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {},
        "Options": {
            "com.docker.network.bridge.default_bridge": "true",
            "com.docker.network.bridge.enable_icc": "true",
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
            "com.docker.network.bridge.name": "docker0",
            "com.docker.network.driver.mtu": "1500"
        },
        "Labels": {}
    }
]

sudo docker network inspect docker_gwbridge

[
    {
        "Name": "docker_gwbridge",
        "Id": "8799e71f7cb3392f704cfaaaf4c84ec1609240df2fe3cd820d9f87c52cff54d7",
        "Created": "2020-03-13T11:58:56.682955942-07:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "ingress-sbox": {
                "Name": "gateway_ingress-sbox",
                "EndpointID": "7776f228c8279348ebbeb331e31f055cc955f2dde72f9cca89ce47ae76028f2e",
                "MacAddress": "02:42:ac:12:00:02",
                "IPv4Address": "172.18.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.bridge.enable_icc": "false",
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.bridge.name": "docker_gwbridge"
        },
        "Labels": {}
    }
]

Wireshark capture shows that connection is being reset

|2|0.706409096|02:42:ac:11:00:02|Broadcast|ARP|42|Who has 172.17.0.1? Tell 172.17.0.2|
|---|---|---|---|---|---|---|
|3|0.706484847|02:42:a3:d8:70:b4|02:42:ac:11:00:02|ARP|42|172.17.0.1 is at 02:42:a3:d8:70:b4|
|4|0.706492056|172.17.0.2|172.17.0.1|TCP|74|37812 → 27017 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=1798269233 TSecr=0 WS=128|
|5|0.706535508|172.17.0.1|172.17.0.2|TCP|54|27017 → 37812 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0|
|6|0.708572052|172.17.0.2|172.17.0.1|TCP|74|37814 → 27017 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=1798269236 TSecr=0 WS=128|
|7|0.708603281|172.17.0.1|172.17.0.2|TCP|54|27017 → 37814 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0|
|8|0.717341783|172.17.0.2|172.17.0.1|ICMP|98|Echo (ping) request  id=0x000f, seq=1/256, ttl=64 (reply in 9)|
|9|0.717389764|172.17.0.1|172.17.0.2|ICMP|98|Echo (ping) reply    id=0x000f, seq=1/256, ttl=64 (request in 8)|

If i am not wrong; you are trying to install the charts on a another server.

if it is the case;

goto mongod.conf and comment out (put # infront of it) the line

#bindIp: 127.0.0.1

However, you are trying to install the docker on the mongodb server, then use localhost ip (127.0.0.1) instead of public ip

sudo docker run --rm quay.io/mongodb/charts:19.12.1 charts-cli test-connection mongodb://127.0.0.1

I figured out after I posted.
I changed the bindIp: 127.0.0.1 to bindIp: 0.0.0.0