Skip to content

VTAdmin fails on IPv6-only clusters #739

@jordangarside

Description

@jordangarside

VTAdmin fails to connect to vtctld on IPv6-only Kubernetes clusters due to improper address formatting.

Error:

W1219 23:35:57.273443  1 component.go:39] [core] [Channel #1 SubChannel #3]
grpc: addrConn.createTransport failed to connect to {
  Addr: "fd01:10:100:1a01::c0f0:15999",
  ServerName: "",
}. Err: connection error: desc = "transport: Error while dialing: dial tcp: address fd01:10:100:1a01::c0f0:15999: too many colons in address"

Root Cause:

The discovery config uses simple string formatting:

"vtctlds": [
{
"host": {
"fqdn": "%s:%d",
"hostname": "%s:%d"
}
}
],
"vtgates": [
{
"host": {
"hostname": "%s:%d"
}
}
]

"hostname": "%s:%d"

With an IPv6 ClusterIP and port, this produces:
fd01:10:100:1a01::c0f0:15999

Expected Behavior:

IPv6 addresses must be bracketed per RFC 2732:
[fd01:10:100:1a01::c0f0]:15999

Suggested Fix:

Use net.JoinHostPort() which handles both IPv4 and IPv6 correctly:

"hostname": net.JoinHostPort(vtctldServiceIP, strconv.Itoa(vtctldServiceGrpcPort))

Environment:

  • Kubernetes: IPv6-only (single-stack)
  • Operator image: planetscale/vitess-operator:latest
  • Digest: sha256:459c3570105bb7fa986b6049b733833def40aa47bc787d83d3f656d9082f9737

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions