You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When advertise_addr is an IPv6 address, Consul WAN federation breaks and we get a constant stream of warnings that the other server nodes are cannot be looked up:
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]: 2025-03-14T23:12:00.837Z [WARN] agent.server.memberlist.wan: memberlist: Failed to resolve i-02a3c94b46768b01f.aws-eu-west-1/2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302: lookup 2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302: no such host
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]: 2025-03-14T23:12:00.837Z [DEBUG] agent.server: Failed to flood-join server at address: server=i-02a3c94b46768b01f.aws-eu-west-1 address=2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]: error=
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]: | 1 error occurred:
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]: | \t* Failed to resolve i-02a3c94b46768b01f.aws-eu-west-1/2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302: lookup 2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302: no such host
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]: |
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]:
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]: 2025-03-14T23:12:00.837Z [WARN] agent.server.memberlist.wan: memberlist: Failed to resolve i-09a493e6d3274ff9b.aws-eu-west-1/2a05:d018:18a3:f201:7332:d29e:acc1:2a1c:8302: lookup 2a05:d018:18a3:f201:7332:d29e:acc1:2a1c:8302: no such host
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]: 2025-03-14T23:12:00.837Z [DEBUG] agent.server: Failed to flood-join server at address: server=i-09a493e6d3274ff9b.aws-eu-west-1 address=2a05:d018:18a3:f201:7332:d29e:acc1:2a1c:8302
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]: error=
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]: | 1 error occurred:
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]: | \t* Failed to resolve i-09a493e6d3274ff9b.aws-eu-west-1/2a05:d018:18a3:f201:7332:d29e:acc1:2a1c:8302: lookup 2a05:d018:18a3:f201:7332:d29e:acc1:2a1c:8302: no such host
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]: |
Mar 14 23:12:00 i-006ba90b993de97b9 consul[2131]:
Create a Consul 1.20.5 cluster with 3 server nodes (see configuration below)
Running journalctl -u consul on a server node will get constant warnings of the form [WARN] agent.server.memberlist.wan: memberlist: Failed to resolve i-02a3c94b46768b01f.aws-eu-west-1/2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302: lookup 2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302: no such host
Running consul members -token=${CONSUL_MGMT_TOKEN} -wan on a server node will only show the local node as result
# consul members -token=${CONSUL_MGMT_TOKEN}
Node Address Status Type Build Protocol DC Partition Segment
i-006ba90b993de97b9 [2a05:d018:18a3:f200:5cb3:7eb1:257e:1750]:8301 alive server 1.20.5 2 aws-eu-west-1 default <all>
i-02a3c94b46768b01f [2a05:d018:18a3:f202:64d9:1621:ab22:df45]:8301 alive server 1.20.5 2 aws-eu-west-1 default <all>
i-09a493e6d3274ff9b [2a05:d018:18a3:f201:7332:d29e:acc1:2a1c]:8301 alive server 1.20.5 2 aws-eu-west-1 default <all>
# consul members -token=${CONSUL_MGMT_TOKEN} -wan
Node Address Status Type Build Protocol DC Partition Segment
i-006ba90b993de97b9.aws-eu-west-1 [2a05:d018:18a3:f200:5cb3:7eb1:257e:1750]:8302 alive server 1.20.5 2 aws-eu-west-1 default <all>
When `advertise_addr` is an IPv6 address, Consul WAN federation breaks
and we get a constant stream of warnings:
```
[WARN] agent.server.memberlist.wan: memberlist: Failed to resolve
i-02a3c94b46768b01f.aws-eu-west-1/2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302:
lookup 2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302: no such host
```
The LAN <-> WAN join flooder creates IPv6 addresses without square
brackets with `fmt.Sprintf("%s:%d", addr, s.WanJoinPort)`, which
confuses `net.SplitHostPort` in `memberlist.resolveAddr`.
Fixeshashicorp#22225
Overview of the Issue
When
advertise_addr
is an IPv6 address, Consul WAN federation breaks and we get a constant stream of warnings that the other server nodes are cannot be looked up:The reason is that the LAN <-> WAN join flooder is instantiated with a
router.FloodAddrFn
calledaddrFn
that currently cannot handle IPv6 addresses. The callfmt.Sprintf("%s:%d", addr, s.WanJoinPort)
inaddrFn
incorrectly joins an IPv6 address without square brackets to a port, which will be called inserf_flooder.FloodJoins
. The incorrect address will then be passed on atserf_flooder.FloodJoins
with a call tomemberlist.Join
and then we confusenet.SplitHostPort
inmemberlist.resolveAddr
.I have a local branch that avoids this by calling
net.JoinHostPort(host, port string)
instead offmt.Sprintf("%s:%d", addr, s.WanJoinPort)
, which will create valid network addresses of the the form[host]:port
whenever the stringhost
is an IPv6 address.The PR with a fix will be available in a moment.
Reproduction Steps
journalctl -u consul
on a server node will get constant warnings of the form[WARN] agent.server.memberlist.wan: memberlist: Failed to resolve i-02a3c94b46768b01f.aws-eu-west-1/2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302: lookup 2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302: no such host
consul members -token=${CONSUL_MGMT_TOKEN} -wan
on a server node will only show the local node as resultConsul info for both Client and Server
Server info
Operating system and Environment details
Log Fragments
See
Overview of the Issue
aboveThe text was updated successfully, but these errors were encountered: