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

Ephemeral=true时,服务注册失败 #704

Open
MarchGe opened this issue Jan 2, 2024 · 2 comments
Open

Ephemeral=true时,服务注册失败 #704

MarchGe opened this issue Jan 2, 2024 · 2 comments

Comments

@MarchGe
Copy link

MarchGe commented Jan 2, 2024

What version of nacos-sdk-go are you using?

v2.2.5

What version of nacos-sever are you using?

v2.1.2

What version of Go are you using (go version)?

v1.21.4

What operating system (Linux, Windows, …) and version?

windows10 20H2 (19042.1706)

What did you do?

.....
&constant.ClientConfig{
TimeoutMs: 0,
NamespaceId: "",
Username: "user",
Password: "passwd",
NotLoadCacheAtStart: true,
LogLevel: "info",
}
......
ok, err := n.namingClient.RegisterInstance(
vo.RegisterInstanceParam{
ServiceName: serviceInfo.ServiceName,
Ip: "172.19.0.1",
Port: 8080,
Weight: 0,
Enable: true,
Healthy: true,
Ephemeral: true,
ClusterName: "",
GroupName: "customGroup",
},
)

clientConfig和vo.RegisterInstanceParam配置如上,返回值err=nil,ok=false,追进去返回值如图(确信账号和密码没问题):
1

如果其他配置信息都不动,只把Ephemeral改为false,服务注册就没问题了,Ephemeral设成true,就会报图片中的授权错误。

What did you expect to see?

ok=true, err=nil

@binbin0325
Copy link
Member

认证失败了,可以看下服务端日志,追查下详细信息

@MarchGe
Copy link
Author

MarchGe commented Jan 2, 2024

可以重现了,如果使用创建的用户(即非nacos超级用户),授予rw权限,往命名空间public(即namespaceId="")里注册 Ephemeral为 true的服务,就会失败;如果是单独创建一个命名空间,不使用默认的public,就可以注册成功。而超级用户nacos,注册都会成功。有空可以试一下,应该是个bug。
3

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

No branches or pull requests

2 participants