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

IPUtil can't match localhost #5765

Closed
haoyann opened this issue May 18, 2021 · 5 comments
Closed

IPUtil can't match localhost #5765

haoyann opened this issue May 18, 2021 · 5 comments
Assignees
Labels
kind/bug Category issues or prs related to bug.
Milestone

Comments

@haoyann
Copy link
Collaborator

haoyann commented May 18, 2021

Describe the bug
serverAddr use localhost:8848 then IPUtil can't match.
image

Desktop (please complete the following information):

  • Version develop
  • Module [naming/config]
  • SDK [java]

Additional context

Caused by: java.lang.reflect.InvocationTargetException: null
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_271]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_271]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_271]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_271]
	at com.alibaba.nacos.api.config.ConfigFactory.createConfigService(ConfigFactory.java:43) ~[nacos-api-2.0.2-SNAPSHOT.jar:na]
	... 45 common frames omitted
Caused by: java.lang.IllegalArgumentException: The IPv4 or Domain address("localhost") is incorrect.
	at com.alibaba.nacos.common.utils.IPUtil.splitIPPortStr(IPUtil.java:138) ~[nacos-common-2.0.2-SNAPSHOT.jar:na]
	at com.alibaba.nacos.client.config.impl.ServerListManager.<init>(ServerListManager.java:162) ~[nacos-client-2.0.2-SNAPSHOT.jar:na]
	at com.alibaba.nacos.client.config.NacosConfigService.<init>(NacosConfigService.java:74) ~[nacos-client-2.0.2-SNAPSHOT.jar:na]
	... 50 common frames omitted
@realJackSun
Copy link
Collaborator

This problem can be reproduced stably.

@haoyann haoyann added the kind/bug Category issues or prs related to bug. label May 18, 2021
@MentosL
Copy link
Contributor

MentosL commented May 18, 2021

@JackSun-Developer @haoyann The Develop branch has been changed and should work properly。

image

@KomachiSion
Copy link
Collaborator

#5514 This PR caused

@SunJiFengPlus
Copy link
Contributor

i can do this, please assign to me

@KomachiSion
Copy link
Collaborator

KomachiSion commented May 25, 2021

This issue is not solve completely

Caused by: java.lang.IllegalArgumentException: The IPv4 or Domain address("localhost") is incorrect.
        at com.alibaba.nacos.common.utils.IPUtil.splitIPPortStr(IPUtil.java:138)
        at com.alibaba.nacos.core.cluster.MemberUtil.singleParse(MemberUtil.java:76)
        at com.alibaba.nacos.core.cluster.ServerMemberManager.init(ServerMemberManager.java:139)
        at com.alibaba.nacos.core.cluster.ServerMemberManager.<init>(ServerMemberManager.java:132)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:175)
        ... 118 common frames omitted

If the cluster.conf set localhost still can't use

SunJiFengPlus pushed a commit to SunJiFengPlus/nacos that referenced this issue May 26, 2021
KomachiSion pushed a commit that referenced this issue May 27, 2021
* rename IPUitl to InternetAddressUtil

* move isDomain to InternetAddressUtil

* [ISSUE #5765] fix localhost not match ip

* fix typo

* delete the verification IP, follow the single responsibility principle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug.
Projects
None yet
Development

No branches or pull requests

5 participants