Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support IPv6 #4156

Open
pvanbuijtene opened this issue Feb 13, 2024 · 0 comments
Open

Support IPv6 #4156

pvanbuijtene opened this issue Feb 13, 2024 · 0 comments
Labels

Comments

@pvanbuijtene
Copy link
Member

There are scenarios where IPv6 is not working as expected, we should look into supporting it so the server doesn't generate errors or invalid configurations.

This investigation into IPv6 got triggered by: #4036

Some tested scenario's and their current results:

Single Node

Minimal secure configuration with any IP and:

Config:

IntIp: "::"
ExtIp: "::"

Curl:

curl -v --insecure --fail -X GET "https://admin:changeit@[::1]:2113/gossip"

Returns invalid gossip:

  "internalTcpIp": "::",
  "externalTcpIp": "::",
  "httpEndPointIp": "::",

Minimal secure configuration with specific IP:

Config:

IntIp: "fd0c:4e34:7285:4620:ec38:485e:c3f8:cfc3"
ExtIp: "fd0c:4e34:7285:4620:ec38:485e:c3f8:cfc3"

Curl:

curl -v --insecure --fail -X GET "https://admin:changeit@[fd0c:4e34:7285:4620:ec38:485e:c3f8:cfc3]:2113/gossip"

Looks like it's working.

Cluster

Specific IP & gossip with IP:

Config:

IntIp: "fd0c:4e34:7285:4620:ec38:485e:c3f8:cfc3"
ExtIp: "fd0c:4e34:7285:4620:ec38:485e:c3f8:cfc3"
GossipSeed: "[fd0c:4e34:7285:4620:ec38:485e:c3f8:cfc3]:2113,[fd0c:4e34:7285:4620:ec38:485e:c3f8:cfc3]:2114"

Error:

[ 8332, 1,10:07:12.205,FTL] Host terminated unexpectedly.
System.Exception: Invalid format for gossip seed port: 4e34:7285:4620:ec38:485e:c3f8:cfc3]:2114
  at EventStore.Core.ClusterVNodeOptions.ParseGossipEndPoint(String val) in D:\a\TrainStation\TrainStation\build\oss-eventstore\src\EventStore.Core\ClusterVNodeOptions.Framework.cs:line 70

Specific IP & gossip with hostname:

Config:

IntIp: "fd0c:4e34:7285:4620:ec38:485e:c3f8:cfc3"
ExtIp: "fd0c:4e34:7285:4620:ec38:485e:c3f8:cfc3"
GossipSeed: "localhost-ipv6:2114,localhost-ipv6:2115"

On follower:

[19092,14,09:56:49.005,ERR] Failed to connect to leader ["Priority: 0 VND {907a2e9b-2fa8-4e2f-b422-7cdfccd00d68} <LIVE> [PreReplica, n/a, Unspecified/fd0c:4e34:7285:4620:ec38:485e:c3f8:cfc3:13112, n/a, Unspecified/fd0c:4e34:7285:4620:ec38:485e:c3f8:cfc3:13113, Unspecified/fd0c:4e34:7285:4620:ec38:485e:c3f8:cfc3:2115, (ADVERTISED: HTTP::0, TCP::0)] 14618/25604/25604/E342@24940:{6b049282-fc4c-4312-91a6-70cff4b08bb0} | 2023-11-06 08:56:44.945"]. This will be retried.
System.Exception: Could not get an IPv4 address for host 'fd0c:4e34:7285:4620:ec38:485e:c3f8:cfc3'
at EventStore.Common.Utils.EndpointExtensions.ResolveDnsToIPAddress(EndPoint endpoint) in D:\a\TrainStation\TrainStation\build\oss-eventstore\src\EventStore.Common\Utils\EndpointExtensions.cs:line 52
at EventStore.Core.Services.Transport.Tcp.TcpConnectionManager..ctor(String connectionName, Guid connectionId, ITcpDispatcher dispatcher, IPublisher publisher, String targetHost, String[] otherNames, EndPoint remoteEndPoint, TcpClientConnector connector, Boolean useSsl, ServerCertificateValidator sslServerCertValidator, Func1 sslClientCertificatesSelector, IPublisher networkSendQueue, IAuthenticationProvider authProvider, AuthorizationGateway authorization, TimeSpan heartbeatInterval, TimeSpan heartbeatTimeout, Action1 onConnectionEstablished, Action`2 onConnectionClosed) in D:\a\TrainStation\TrainStation\build\oss-eventstore\src\EventStore.Core\Services\Transport\Tcp\TcpConnectionManager.cs:line 177
at EventStore.Core.Services.Replication.ReplicaService.ConnectToLeader(Guid leaderConnectionCorrelationId, MemberInfo leader) in D:\a\TrainStation\TrainStation\build\oss-eventstore\src\EventStore.Core\Services\Replication\ReplicaService.cs:line 165

Any IP & gossip with hostname

Config:

IntIp: "::"
ExtIp: "::"
GossipSeed: "localhost-ipv6:2113,localhost-ipv6:2114"

Error:

[11640,22,11:09:56.920,INF] View Change Send Failed to "Unspecified/:::2114"
System.AggregateException: One or more errors occurred. (Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: IPv4 address 0.0.0.0 and IPv6 address ::0 are unspecified addresses that cannot be used as a target address. (Parameter 'hostName') ([::]:2114) ArgumentException: IPv4 address 0.0.0.0 and IPv6 address ::0 are unspecified addresses that cannot be used as a target address. (Parameter 'hostName')", DebugException="System.Net.Http.HttpRequestException: IPv4 address 0.0.0.0 and IPv6 address ::0 are unspecified addresses that cannot be used as a target address. (Parameter 'hostName') ([::]:2114)
---> System.ArgumentException: IPv4 address 0.0.0.0 and IPv6 address ::0 are unspecified addresses that cannot be used as a target address. (Parameter 'hostName')
...
at Grpc.Net.Client.Internal.GrpcCall2.RunCall(HttpRequestMessage request, Nullable1 timeout)")
at EventStore.Core.Cluster.EventStoreClusterClient.SendViewChangeAsync(Guid serverId, EndPoint serverHttpEndPoint, Int32 attemptedView, DateTime deadline) in D:\a\TrainStation\TrainStation\build\oss-eventstore\src\EventStore.Core\Cluster\EventStoreClusterClient.Elections.cs:line 105
--- End of inner exception stack trace ---

Localhost & gossip with hostname

Config:

IntIp: "::1"
ExtIp: "::1"
GossipSeed: "localhost-ipv6:2114,localhost-ipv6:2115"

Error:

[18920,14,11:30:15.050,ERR] Failed to connect to leader ["Priority: 0 VND {06be41dd-54fe-4bd3-98d9-39f00159ccba} <LIVE> [Leader, n/a, Unspecified/::1:11112, n/a, Unspecified/::1:11113, Unspecified/::1:2113, (ADVERTISED: HTTP::0, TCP::0)] 208973/209350/209350/E354@208682:{527512cd-b9c5-4b07-b110-40788f101c87} | 2023-11-06 10:30:15.001"]. This will be retried.
System.Exception: Could not get an IPv4 address for host '::1'
   at EventStore.Common.Utils.EndpointExtensions.ResolveDnsToIPAddress(EndPoint endpoint) in D:\a\TrainStation\TrainStation\build\oss-eventstore\src\EventStore.Common\Utils\EndpointExtensions.cs:line 52
   at EventStore.Core.Services.Transport.Tcp.TcpConnectionManager..ctor(String connectionName, Guid connectionId, ITcpDispatcher dispatcher, IPublisher publisher, String targetHost, String[] otherNames, EndPoint remoteEndPoint, TcpClientConnector connector, Boolean useSsl, ServerCertificateValidator sslServerCertValidator, Func`1 sslClientCertificatesSelector, IPublisher networkSendQueue, IAuthenticationProvider authProvider, AuthorizationGateway authorization, TimeSpan heartbeatInterval, TimeSpan heartbeatTimeout, Action`1 onConnectionEstablished, Action`2 onConnectionClosed) in D:\a\TrainStation\TrainStation\build\oss-eventstore\src\EventStore.Core\Services\Transport\Tcp\TcpConnectionManager.cs:line 177
   at EventStore.Core.Services.Replication.ReplicaService.ConnectToLeader(Guid leaderConnectionCorrelationId, MemberInfo leader) in D:\a\TrainStation\TrainStation\build\oss-eventstore\src\EventStore.Core\Services\Replication\ReplicaService.cs:line 165

Localhost & gossip with ip

Config:

IntIp: "::1"
ExtIp: "::1"
GossipSeed: "[::1]:2113,[::1]:2114"

Error:

[12464, 1,11:34:12.622,FTL] Host terminated unexpectedly.
System.Exception: Invalid format for gossip seed port: :1]:2114
   at EventStore.Core.ClusterVNodeOptions.ParseGossipEndPoint(String val) in D:\a\TrainStation\TrainStation\build\oss-eventstore\src\EventStore.Core\ClusterVNodeOptions.Framework.cs:line 70

Untested but for sure have to check, DNS Discovery with IPv6

DB-490

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant