consul validate returns valid with misconfigured service
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
When filing a bug, please include the following headings if possible. Any example text in this template can be deleted.
#### Overview of the Issue
`consul validate` seems to see badly configured services as valid.
#### Reproduction Steps
Using a service configuration like below in `/etc/consul/service.json`:
```
# cat /etc/consul/service.json
{
"service": {
"address": "127.0.0.1",
"checks": [
{
"interval": "10s",
"name": "consul test service",
"script": "/bin/true",
"ttl": "10s"
}
],
"enableTagOverride": false,
"id": "test service",
"name": "test service",
"port": 9137,
"tags": [
]
}
}
```
validate returns that the configuration is good:
```
# consul validate /etc/consul
Configuration is valid!
```
but starting consul fails:
```
# /usr/bin//consul agent -config-dir /etc/consul
WARNING: LAN keyring exists but -encrypt given, using keyring
==> Starting Consul agent...
==> Error starting agent: Failed to validate checks for service "consul-test-service": Interval and TTL cannot both be specified
```
### Consul info for both Client and Server
consul 1.0.8
### Operating system and Environment details
```
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
```
```
4.9.0-12-amd64
```
Contributor guide
Assessment
This issue has not been assessed yet.