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

help! connect nacos by ipv6 #3805

Open
BennettChina opened this issue Jul 19, 2024 · 2 comments
Open

help! connect nacos by ipv6 #3805

BennettChina opened this issue Jul 19, 2024 · 2 comments
Labels
area/nacos spring cloud alibaba nacos kind/question stale waiting-for-feedback Waiting for user feedback

Comments

@BennettChina
Copy link

BennettChina commented Jul 19, 2024

I want to use ipv6 connect the nacos server, but I encountered some problems!

我想要IPv6连接 nacos ,但是遇到了一些报错。

My env is this:

我使用的环境是:

nacos-server: 2.3.2
spring-cloud: Hoxton.SR12
spring-boot: 2.3.12.RELEASE
sca: 2.2.9.RELEASE

and my application config is:
我的spring-boot配置是:

spring:
  cloud:
    nacos:
      discovery:
        server-addr: "[::1]:8848"
      config:
        server-addr: ${spring.cloud.nacos.discovery.server-addr}
        file-extension: yml
        shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
      username: nacos
      password: nacos
management:
  endpoints:
    enabled-by-default: false
  endpoint:
    gateway:
      enabled: false
    health:
      enabled: true

Which Component
Nacos Discovery

Describe what problem you have encountered
I tried version 2.2.9 of sca and encountered the following error message.
我尝试了2.2.9版本的sca,遇到了以下报错信息。

java.lang.IllegalArgumentException: Invalid host or port: [ 9848
	at com.alibaba.nacos.shaded.io.grpc.internal.GrpcUtil.authorityFromHostAndPort(GrpcUtil.java:488)
	at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder.<init>(NettyChannelBuilder.java:133)
	at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder.forAddress(NettyChannelBuilder.java:119)
	at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.grpc.netty.NettyChannelProvider.builderForAddress(NettyChannelProvider.java:37)
	at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.grpc.netty.NettyChannelProvider.builderForAddress(NettyChannelProvider.java:23)
	at com.alibaba.nacos.shaded.io.grpc.ManagedChannelBuilder.forAddress(ManagedChannelBuilder.java:39)
	at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.createNewChannelStub(GrpcClient.java:143)
	at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.connectToServer(GrpcClient.java:299)
	at com.alibaba.nacos.common.remote.client.RpcClient.reconnect(RpcClient.java:521)
	at com.alibaba.nacos.common.remote.client.RpcClient.lambda$start$2(RpcClient.java:369)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)
Caused by: java.net.URISyntaxException: Expected closing bracket for IPv6 address at index 8: //[:9848
	at java.net.URI$Parser.fail(URI.java:2847)
	at java.net.URI$Parser.failExpecting(URI.java:2853)
	at java.net.URI$Parser.parseServer(URI.java:3230)
	at java.net.URI$Parser.parseAuthority(URI.java:3154)
	at java.net.URI$Parser.parseHierarchical(URI.java:3096)
	at java.net.URI$Parser.parse(URI.java:3062)
	at java.net.URI.<init>(URI.java:673)
	at com.alibaba.nacos.shaded.io.grpc.internal.GrpcUtil.authorityFromHostAndPort(GrpcUtil.java:486)
	... 16 common frames omitted

After I upgraded to 2.2.10-RC, the above error no longer appeared, but the configuration information could not be obtained, and the following error appeared in the log.
当我升级至2.2.10-RC后,上面的报错不再出现,但获取不到配置信息,日志出现了下面的报错。

[NacosClientAuthServiceImpl] login http request failed url: http://[::1]:8848/nacos/v1/auth/users/login, params: {username=nacos}, bodyMap: {password=nacos}, errorMsg: Unexpected end of file from server

Describe what information you have read
yes.

I want to know which version can connect nacos using IPv6.
我想知道哪个版本可以使用IPv6连接nacos。

@BennettChina BennettChina changed the title helpconnect nacos by ipv6 help! connect nacos by ipv6 Jul 19, 2024
@yuluo-yx yuluo-yx added kind/question area/nacos spring cloud alibaba nacos labels Jul 20, 2024
@yuluo-yx
Copy link
Collaborator

yuluo-yx commented Jul 29, 2024

用 2023 版本试试,可以参考看看 https://sca.aliyun.com/docs/2023/overview/version-explain/

@yuluo-yx yuluo-yx added the waiting-for-feedback Waiting for user feedback label Jul 29, 2024
Copy link

This issue has been open 30 days with no activity. This will be closed in 7 days.

@github-actions github-actions bot added the stale label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/nacos spring cloud alibaba nacos kind/question stale waiting-for-feedback Waiting for user feedback
Projects
None yet
Development

No branches or pull requests

2 participants