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

modify_naming_instance raise NacosException code is 400 #210

Open
lingfengchencn opened this issue Feb 8, 2025 · 1 comment
Open

modify_naming_instance raise NacosException code is 400 #210

lingfengchencn opened this issue Feb 8, 2025 · 1 comment

Comments

@lingfengchencn
Copy link

when i modify naming instance got error ,codes:

self.client = nacos.NacosClient(server_addresses=self.host, 
                                namespace=self.namespace,
                                username=self.username,
                                password=self.password)


  self.client.add_naming_instance(service.service_name, service.host, service.port, 
                                  weight=service.weight,
                          metadata=service.to_dict(),
                          enable=service.is_healthy,
                          group_name=self.group, cluster_name=self.cluster,heartbeat_interval=service.heartbeat_interval)
  self.client.modify_naming_instance(service.service_name, service.host, service.port)

add_naming_instance works fine ,but when i modify ,get error:

  File "/Volumes/Codes/*/*/utils/nacos_util.py", line 36, in add_service
    self.client.modify_naming_instance(service.service_name, service.host, service.port)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Volumes/Codes/*/*/.venv/lib/python3.13/site-packages/nacos/client.py", line 1079, in modify_naming_instance
    raise NacosException("Request Error, code is %s" % e.code)
nacos.exception.NacosException: Request Error, code is 400


@jaychang1989
Copy link

应该是你的config命名空间和discover命名空间不一致导致的

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