Skip to content

nacos server修改nacos.server.contextPath导致注册失败问题 #300

@IcanDoItL

Description

@IcanDoItL

1、服务版本
python版本3.12
nacos-sdk-python 3.0.2
nacos注册中心版本3.0.3
fastapi版本 0.121.2

2、复现步骤

①、修改nacos-server-3.0.3\nacos\conf\application.properties属性为如下取值
nacos.server.contextPath=/
nacos.core.auth.enabled=true
②、重启nacos-server
③、进行nacos注册
naming_client = await NacosNamingService.create_naming_service(nacos_client_config)

会有[500]: get access token failed报错

问题原因:
https://github.com/nacos-group/nacos-sdk-python/blob/master/v2/nacos/transport/auth_client.py 34行
url = server_address + "/nacos/v1/auth/users/login" 前缀必须有/nacos

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions