I got this “dial tcp: address 2601:547:980:b3e0::677c:32774: too many colons in address” error today and would like to see if anyone could help me. More details follow.
My Environment
-
Ubuntu 18.04
-
Consul 1.8.4 and 1.6.3 [1]
-
consul agent
arguments:-raft-protocol=3
-config-dir=/etc/ywen/consul/consul.d
-data-dir=/var/lib/consul/data.d
-enable-local-script-checks
-server
-node-id=232377e0-de74-4088-9647-e0d04f6cdf90
-ui
-bind 2601:547:980:b3e0::677c
-client ::1 127.0.0.1 172.28.128.1 192.0.2.1 198.51.100.1
-
We use
Registrator
to register Docker containers as services toConsul
. -
We use
Ansible
to configure the target machine.
The error was about TCP-checking the health of a postgres:13
Docker container which was set up in our Ansible playbook this way:
docker_container:
env:
SERVICE_CHECK_TCP: "true"
SERVICE_CHECK_INTERVAL: 15s
SERVICE_CHECK_TIMEOUT: 1s
# Other `docker_container` arguments.
My Efforts
- I found the PR " Ensure Consul is IPv6 compliant" but this bug was fixed as early as
1.5.2
. I’m assuming what I’m encountering is not a regressional issue. - I confirmed that the PostgreSQL container was running properly when this error happened.
- I ran
pg_isready
to test the database connection and it reported “good”:
ywen@ywen-Precision-7510:/tmp$ pg_isready --host=2601:547:980:b3e0::677c --port=32774
2601:547:980:b3e0::677c:32774 - accepting connections
- I’m guessing that when
Registrator
used the IPv6 address to register the container toConsul
and, perhaps, somehowConsul
didn’t handle the registration properly(??) so the IPv6 address was not quoted correctly. I’m guessing so because I tried to change the-bind
argument to my IPv4 address but didn’t fix the error.Consul
still reported health check failure with the IPv6 address as shown above.
Could someone help me? Could this be some misconfiguration somewhere I’m not aware of?
Notes
- [1] My project uses
1.6.3
which was released in Jan 2020. I tried the latest1.8.4
today after I found this error and still got the same error.