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

consul force-leave is not validating input #3757

Open
samm-git opened this issue Dec 19, 2017 · 3 comments
Open

consul force-leave is not validating input #3757

samm-git opened this issue Dec 19, 2017 · 3 comments
Labels
theme/api Relating to the HTTP API interface theme/cli Flags and documentation for the CLI interface type/bug Feature does not function as expected
Milestone

Comments

@samm-git
Copy link

If you have a question, please direct it to the
consul mailing list if it hasn't been
addressed in either the FAQ or in one
of the Consul Guides.

When filing a bug, please include the following:

consul version for both Client and Server

Client: 0.9.3+ent
Server: 0.9.3+ent

Description of the Issue (and unexpected/desired result)

Consul force-leave command command is not validating input. So if there is a typo or misunderstanding (e.g. using ip instead of node name) consul will silently accept it without any actions. I think it should return "node not found" or something like that.

Reproduction steps

 ~ $ consul force-leave nonexisting;echo $?
0
@slackpad slackpad added type/bug Feature does not function as expected theme/cli Flags and documentation for the CLI interface theme/api Relating to the HTTP API interface labels Dec 19, 2017
@slackpad slackpad added this to the Unplanned milestone Dec 19, 2017
@hanshasselberg
Copy link
Member

Would you accept a PR for this issue?

@kyhavlov
Copy link
Contributor

We would definitely accept a PR for this, but it looks like the issue here is that the Serf library doesn't return an error when trying to call force-leave on a non-existent node. The CLI command is validating that it gets a successful response from the API, but that doesn't return an error here.

@hanshasselberg
Copy link
Member

@kyhavlov I think I have a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/api Relating to the HTTP API interface theme/cli Flags and documentation for the CLI interface type/bug Feature does not function as expected
Projects
None yet
Development

No branches or pull requests

4 participants