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 doesn't understand ExposedPort JSON field sent by ESM #183

Open
Riscky opened this issue Nov 18, 2022 · 1 comment
Open

Consul doesn't understand ExposedPort JSON field sent by ESM #183

Riscky opened this issue Nov 18, 2022 · 1 comment

Comments

@Riscky
Copy link

Riscky commented Nov 18, 2022

When running Consul ESM v0.6.2 together with Consul v1.10.4, the following warning is logged:

{
  "@level": "warn",
  "@message": "Error updating check status in Consul",
  "@module": "consul-esm",
  "@timestamp": "2022-11-18T12:45:58.035983+01:00",
  "error": "Failed request: Failed to parse body: json: unknown field \"ExposedPort\""
}

when trying to register a health status change.

Although this is logged as a warning, this actually means that ESM does not register health status changes at all.

I tried debugging this a bit, and as far as I understand the code, the inner error (Failed to parse body: json: unknown field \"ExposedPort\") is thrown by Consul (not ESM).
The release notes of Consul v1.10.0 lists the addition of the ExposedPort to the healthcheck API though.

ESM v0.6.x might just not be compatible with Consul v1.10.x and lower, in which case that should be added to the compatibility table in the readme.

I also think the warning should be promoted to an error, because registering health status changes is the primary function of ESM.

@ulidtko
Copy link

ulidtko commented Sep 2, 2024

Beyond the docs, please also update version.go:

// consulVersionConstraint is the compatible version constraint
// between ESM with Consul.
const consulVersionConstraint = ">= 1.4.1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants