nacos-group / nacos-group/nacos-sdk-python
nacos server修改nacos.server.contextPath导致注册失败问题
@GoofySatoshi is already working on this.
Since Mar 11, 2026.
- Dominant language
- Python
- Stars
- 471
- Forks
- 155
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.