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

Unable to deregister service if multiple nodes available #9415

Closed
frankiedrake opened this issue Dec 16, 2020 · 1 comment · Fixed by #10894
Closed

Unable to deregister service if multiple nodes available #9415

frankiedrake opened this issue Dec 16, 2020 · 1 comment · Fixed by #10894
Labels
theme/catalog Relating to the catalog of nodes, services, and checks type/question Not an "enhancement" or "bug". Please post on discuss.hashicorp

Comments

@frankiedrake
Copy link

We have consul with multiple nodes in our environment.
I'm using spring-cloud-starter-consul-discovery do register my app instances as a services. And I faced a problem when deregistering services. I'm getting an error:

Unknown service {"<service-name>" {}}

I tried to repeat the same request with a curl and got the same error.
Command I execute:

curl -v -X PUT -H 'X-Consul-Token: ***' https://consul-host/v1/agent/service/deregister/<service-name>

What I noticed is that repeating the request multiple times results in success service deregistration.
I guess that what happens is some round-robin behavior, and each time the request is falling in a different node.
I don't know if this is an expected behavior, but maybe it's possible to find some workaround for this issue.
What I need is to deregister my service automatically when stopping/rebooting the application.

@jsosulska jsosulska added type/question Not an "enhancement" or "bug". Please post on discuss.hashicorp theme/catalog Relating to the catalog of nodes, services, and checks labels Feb 4, 2021
@jkirschner-hashicorp
Copy link
Contributor

Hi @frankiedrake ,

My apologies for the delayed response. I'm unfamiliar with the spring-cloud-consul Github project. It may make sense to post there to understand why service deregistrations through spring-cloud-consul aren't working.


However, I can speak to why the curl command you issued may not have worked: you may have used a service name rather than a service id in the call. The deregister endpoint requires a service id.

This is a very easy mistake to make. We should make it easier to avoid, or detect/fix, this mistake. I'm tracking such improvements in #10861.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/catalog Relating to the catalog of nodes, services, and checks type/question Not an "enhancement" or "bug". Please post on discuss.hashicorp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants