-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Config folder with many json definition files: Health checks are not correctly registered #3554
Comments
@javicrespo Can you provide the two service files? |
I can reproduce this now. I think this is - unfortunately - a consequence of #3179. To set an When the ID of the check is not set then the agent will register the check with the id However, the new config parser is more strict and at the same time provides a stepping stone to fix #3179. It accepts both You can reproduce the same behavior with 0.9.3 by using
Therefore, if you provide check ids they have to be unique per agent. I'll update the changelog to make sure that this is clear. |
Thanks for the info! This paragraph from the doc should be corrected though:
https://www.consul.io/docs/agent/checks.html With what you said above
|
Fixed in #3557, including a documentation update. |
consul version
for both Client and ServerClient:
1.0.0-beta2
Server:
1.0.0-beta2
consul info
for both Client and ServerClient:
Server:
Operating system and Environment details
Windows 2012 R2
Description of the Issue (and unexpected/desired result)
We use a folder with several json files to configure a consul agent. In one of our DEV servers we have one consul agent and several services on the same machine. So in the config folder, we have a _basic-config.json for the agent configuration, and a json file for each service, each one defining its own http api health check
While testing 1.0.0-beta2, we've realized that only the HTTP API healtcheck of the last (alphabetically ordered) service is registered. All the other services are included in Consul, but the only health check that is defined for them is Serf's.
So for example:
So while both Service1 and Service2 are registered in Consuol, only Service2.json's health checks are.
With version 0.9.3 all the API health checks were correctly registered for all the services. Using 1.0.0-beta2 for the server and 0.9.3 for the client works as expected.
I've just noticed that all the checks have the same id="api", so I suspect, they are getting overwritten somewhere here: https://github.com/hashicorp/consul/blob/master/agent/config/builder.go#L211
As the check is defined as a nested entity within the service definition, I'd expect that the id should be unique within the service definition, not across the agent(?)
Reproduction steps
Use 1.0.0-beta2 for the consul client. Create a config folder with at least 2 json files, each of them defining a different service with its http healtcheck http api. Only the "last" healtcheck is registered in consul.
The text was updated successfully, but these errors were encountered: