0

I am working on redoing our consul cookbook to work with 1.3.0 and have ran into an issue. I can't seem to track down anything online that points to what it might be.

The issue(s), when I try to register a health check is gives me Invalid check: TTL must be > 0 for TTL checks Error when I try to register any type of check, I have two examples below. Both of which are not TTL checks but are instead script checks.

As you can see neither of the checks are TTL checks but both script checks. I can not seem to figure out how to get script checks to work with the new version of consul.

Another related error if I try to interact with the consul binary that I somehow am required to include something or get a 403 error even if I AM including the ACL token already. Any ideas on what this might be? It makes it hard to reload the service without redeploying the whole system and adding in the check before I start consul.

ping.json

{
"name": "ping",
"check": {
"name": "ping",
"args": ["ping", "-c1", "google.com"],
"interval": "30s"
}
}

mem.json

{
"name": "mem check",
"check": {
"id": "mem-util",
"name": "Memory utilization",
"args": ["/work-disk/scripts/check_mem.pl", "--f", "-C", "-w", "20", "-c", "10"],
"interval": "10s",
"timeout": "1s"
}
}

curl command used to register check

curl -v -H "Content-Type: application/json" --header "X-Consul-Token <token>" --request PUT --data @mem.json http://localhost:8500/v1/agent/check/register

Tried with a TTL check using the below JSON and it gave the exact same error. The check is directly from the docs except I added a name otherwise it errors out

ttl.json

{
"check": {
"id": "web-app",
"name": "Web App Status",
"notes": "Web app does a curl internally every 10 seconds",
"ttl": "30s"
}
}
  • Can you add the logs from consul when you do those requests ? – Tensibai Nov 7 '18 at 16:49
  • @Tensibai What logs are useful? I have no clue about consul and am learning it as I go. – Josh Kirby Nov 8 '18 at 16:23
  • Well, the server logs, I don't know if you configured them or not, the doc to this is here support.hashicorp.com/hc/en-us/articles/… in case it may help – Tensibai Nov 8 '18 at 18:55
  • @Tensibai Haven't configured any no. I am working off a consul 0.7.1 cookbook and updating it. I will add some logging with that and see if it helps any. – Josh Kirby Nov 8 '18 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.