nacos-group / nacos-group/nacos-sdk-python

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

Open
#300 1 comment 0 reactions 1 assignee View on GitHub

@GoofySatoshi is already working on this.

Since Mar 11, 2026.

bug good first issue
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.