Invalid argument error from Java client connecting to ipv6 server

299 views
Skip to first unread message

Jiongxin Liu

unread,
Jan 20, 2023, 6:32:35 PM1/20/23
to grpc.io
Hi everyone,

I have an ipv6 server with address [202:a01:310:234:b01:34a:41a:33e]:9999.

I tried to make Java client connect to it by passing the string form of the above address, but got error:
io.grpc.netty.shaded.io.netty.channel.AbstractChannel$AnnotatedConnectException: connect(..) failed: Invalid argument: /202:a01:310:234:b01:34a:41a:33e:9999
Not use why the format changes...

I also tried another format such as %5B202:a01:310:234:b01:34a:41a:33e%5D:9999, but got error again:
 java.net.URISyntaxException: Malformed IPv6 address at index 3: //[%5B202:a01:310:234:b01:34a:41a:33e%5D]:9999

The versions is 1.52.1 for io.grpc.

How can I resolve the problem?

Thanks!


sanjay...@google.com

unread,
Jan 26, 2023, 3:34:59 PM1/26/23
to grpc.io
Did you use ManagedChannelBuilder.forTarget()  ? According to the doc ,  something like "[2001:db8:85a3:8d3:1319:8a2e:370:7348]:443" should have worked - which is what you are using. Unless you are using a different API. Also can you try with one of the suggested formats e.g. "dns:///%5B2001:db8:85a3:8d3:1319:8a2e:370:7348%5D:443"
Reply all
Reply to author
Forward
0 new messages