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

Docs: Example shows TTL and Interval; results in "Invalid check" error #6343

Closed
huttj opened this issue Aug 16, 2019 · 3 comments · Fixed by #6753
Closed

Docs: Example shows TTL and Interval; results in "Invalid check" error #6343

huttj opened this issue Aug 16, 2019 · 3 comments · Fixed by #6753
Labels
type/docs Documentation needs to be created/updated/clarified

Comments

@huttj
Copy link

huttj commented Aug 16, 2019

Overview of the Issue

The Sample Payload for registering a service via HTTP includes a JSON body with both Interval and TTL. When using both of these, the API responds with Invalid check: Interval and TTL cannot both be specified.

Reproduction Steps

  1. Run consul agent -dev
  2. Run curl http://localhost:8500/v1/agent/service/register -X PUT -d '{"Id":"123456","Name":"test-service","Port":5000,"Check":{"HTTP":"http://localhost:5000/health","Interval":"10s","TTL":"15s”}}’

Consul info for both Client and Server

Configuration is default

Operating system and Environment details

n/a

Log Fragments

2019/08/16 14:34:36 [DEBUG] http: Request PUT /v1/agent/service/register (132.336µs) from=127.0.0.1:60983
2019/08/16 14:34:37 [DEBUG] manager: Rebalanced 1 servers, next active server is joshuahutt-mac.dc1 (Addr: tcp/127.0.0.1:8300) (DC: dc1)
2019/08/16 14:34:40 [DEBUG] consul: Skipping self join check for "joshuahutt-mac" since the cluster is too small
2019/08/16 14:35:19 [DEBUG] agent: Skipping remote check "serfHealth" since it is managed automatically
2019/08/16 14:35:19 [DEBUG] agent: Node info in sync
2019/08/16 14:35:40 [DEBUG] consul: Skipping self join check for "joshuahutt-mac" since the cluster is too small
@hanshasselberg hanshasselberg added the type/docs Documentation needs to be created/updated/clarified label Aug 19, 2019
@kkbatta
Copy link

kkbatta commented Sep 5, 2019

We are seeing the same issue. Could someone explain why these two have to be mutually exclusive?
I do not want the call back to execute until the check fails 3 times consecutively. I am trying to achieve this by giving interval as 10s and ttl as 31s . I am sure I am reading something wrong.
Any pointers towards how this can be achieved will be greatly appreciated.
The document referred: https://www.consul.io/docs/agent/checks.html
Java client used: https://github.com/rickfast/consul-client
Sample code:

Check newHealthCheck = ImmutableCheck.builder().id("leader").name("leader").http("http://127.0.0.1:8080/health").interval("10s").ttl("31s").build();
client.agentClient().registerCheck(newHealthCheck);

blake added a commit that referenced this issue Nov 7, 2019
Timeout/TTL and Interval options were made mutually exclusive in
#3560.

Resolves #6343
blake added a commit that referenced this issue Nov 8, 2019
TTL and Interval options were made mutually exclusive in
#3560.

Change to Timeout, which is a correct parameter for HTTP, Script, and
TCP checks.

Resolves #6343
@blake
Copy link
Member

blake commented Nov 16, 2019

I do not want the call back to execute until the check fails 3 times consecutively.

@kkbatta, if I am understanding correctly, it sounds like you may asking for functionality which was introduced in #5739. Does this look like it would satisfy your requirement?

blake added a commit that referenced this issue Dec 2, 2019
TTL and Interval options were made mutually exclusive in
#3560.

Change to Timeout, which is a correct parameter for HTTP, Script, and
TCP checks.

Resolves #6343
blake added a commit that referenced this issue Dec 2, 2019
TTL and Interval options were made mutually exclusive in
#3560.

Change to Timeout, which is a correct parameter for HTTP, Script, and
TCP checks.

Resolves #6343
@ghost
Copy link

ghost commented Jan 25, 2020

Hey there,

This issue has been automatically locked because it is closed and there hasn't been any activity for at least 30 days.

If you are still experiencing problems, or still have questions, feel free to open a new one 👍.

@ghost ghost locked and limited conversation to collaborators Jan 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants