hashicorp / hashicorp/consul-template
Conul-template is not highly fault-tolerant to Consul failure
- Dominant language
- Go
- Stars
- 4.8k
- Forks
- 801
- Avg merge
- 4h 5m
- Merged PRs (30d)
- 6
Description
In documentation, it's written:
> By default Consul Template is highly fault-tolerant. If Consul is unreachable or a template changes, Consul Template will happily continue running.
https://github.com/hashicorp/consul-template?tab=readme-ov-file#termination-on-error
The observed behavior shows it's not the case. Here are the logs from Consul-template (using the default retry configuration):
```
2025-04-08T13:00:04.590+0200 [WARN] (view) kv.block(config/foo): Get "http://127.0.0.1:8500/v1/kv/config/foo?stale=&wait=60000ms": dial tcp 127.0.0.1:8500: connect: connection refused (retry attempt 12 after "1m0s")
2025-04-08T12:05:43.508+0200 [ERR] (view) kv.block(config/foo): Get "http://127.0.0.1:8500/v1/kv/config/foo?stale=&wait=60000ms": dial tcp 127.0.0.1:8500: connect: connection refused (exceeded maximum retries)
2025-04-08T12:05:43.508+0200 [ERR] (runner) watcher reported error: kv.block(config/foo): Get "http://127.0.0.1:8500/v1/kv/config/foo?stale=&wait=60000ms": dial tcp 127.0.0.1:8500: connect: connection refused
2025-04-08T12:05:43.508+0200 [ERR] (cli) kv.block(config/foo): Get "http://127.0.0.1:8500/v1/kv/config/foo?stale=&wait=60000ms": dial tcp 127.0.0.1:8500: connect: connection refused
Apr 08 12:05:43 systemd[1]: consul-template.service: Main process exited, code=exited, status=14/n/a
Apr 08 12:05:43 systemd[1]: consul-template.service: Failed with result 'exit-code'.
```
Obviously, the service `consul-template` failed because Consul was not reachable
Contributor guide
Assessment
This issue has not been assessed yet.