hashicorp / hashicorp/consul-template

consul-template randomly gets stuck

Open
#1,074 7 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
4.8k
Forks
801
Avg merge
4h 5m
Merged PRs (30d)
6

Description

### Consul Template version

consul-template v0.19.4 (68b1da2)

### Configuration

```hcl
consul {
retry {
enabled = true
attempts = 10
backoff = "250ms"
max_backoff = "30s"
}
}
reload_signal = "SIGHUP"
kill_signal = "SIGINT"
max_stale = "10m"
log_level = "warn"

### ipset-cloud.ctpl
template {
source = "/etc/consul-templater/ipset_cloud.ctpl"
destination = "/output/ipset/cloud.conf"
error_on_missing_key = true
wait {
min = "5s"
max = "10s"
}
}
```

### Template

```liquid
create temp_ips_allowed_cloud hash:ip
{{ range nodes }}add temp_ips_allowed_cloud {{ .Address }}
{{ end }}
swap temp_ips_allowed_cloud ips_allowed_cloud
destroy temp_ips_allowed_cloud
```

### Command

```shell
consul-template -consul-addr=127.0.0.1:8500 -config=consul-template.conf
```

### Debug output

Not reproducible as it gets stuck in 2-3 weeks

### Expected behavior

Not to get stuck

### Actual behavior

file `/output/ipset/cloud.conf` should be updated at least once a minute. At some hosts after 1-2 weeks of uptime file stops being updated.

### Steps to reproduce

1. run consul-template with given configuration
2. wait several days
3. run `stat /output/ipset/cloud.conf` to verify modification date until it stops updating

### References
did not find any

Contributor guide

Open the contributing guide

Research direction

No source files or tests are named. Start with the supplied consul-template configuration and template, then run the command while monitoring /output/ipset/cloud.conf over the long interval described; done means the file continues updating at least once a minute without becoming stuck.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.