hashicorp / consul-template

Template rendering, notifier, and supervisor for @HashiCorp Consul and Vault data.
https://www.hashicorp.com/
Mozilla Public License 2.0
4.76k stars 781 forks source link

-once is not working, consul-template is not exiting #1009

Closed mildred closed 7 years ago

mildred commented 7 years ago

Consul Template version

consul-template v0.19.2 (714c4df)

Configuration

consul {
  address = "http://consul.service.consul:8500"
}

template {
  source      = "jobs/front.nomad.ctmpl"
  destination = "jobs.dev.rendered/front.nomad"
  left_delimiter  = "<%"
  right_delimiter = "%>"
}
    <% if eq (env "SQSC_ENV") "dev" %>
    count = 1
    <% else %>
    count = 3
    <% end %>

Command

bin/consul-template-0.19.2 -log-level=trace -config=consul-template.dev.conf -once

Debug output

2017/09/08 12:42:35.930227 [INFO] consul-template v0.19.2 (714c4df)
2017/09/08 12:42:35.930244 [INFO] (runner) creating new runner (dry: false, once: true)
2017/09/08 12:42:35.930748 [DEBUG] (runner) final config: {"Consul":{"Address":"http://consul.service.consul:8500","Auth":{"Enabled":false,"Username":"","Password":""},"Retry":{"Attempts":12,"Backoff":250000000,"MaxBackoff":60000000000,"Enabled":true},"SSL":{"CaCert":"","CaPath":"","Cert":"","Enabled":false,"Key":"","ServerName":"","Verify":true},"Token":"","Transport":{"DialKeepAlive":30000000000,"DialTimeout":30000000000,"DisableKeepAlives":false,"IdleConnTimeout":90000000000,"MaxIdleConns":100,"MaxIdleConnsPerHost":9,"TLSHandshakeTimeout":10000000000}},"Dedup":{"Enabled":false,"MaxStale":2000000000,"Prefix":"consul-template/dedup/","TTL":15000000000},"Exec":{"Command":"","Enabled":false,"Env":{"Blacklist":[],"Custom":[],"Pristine":false,"Whitelist":[]},"KillSignal":2,"KillTimeout":30000000000,"ReloadSignal":null,"Splay":0,"Timeout":0},"KillSignal":2,"LogLevel":"trace","MaxStale":2000000000,"PidFile":"","ReloadSignal":1,"Syslog":{"Enabled":false,"Facility":"LOCAL0"},"Templates":[{"Backup":false,"Command":"","CommandTimeout":30000000000,"Contents":"","Destination":"jobs.dev.rendered/front.nomad","ErrMissingKey":false,"Exec":{"Command":"","Enabled":false,"Env":{"Blacklist":[],"Custom":[],"Pristine":false,"Whitelist":[]},"KillSignal":2,"KillTimeout":30000000000,"ReloadSignal":null,"Splay":0,"Timeout":30000000000},"Perms":420,"Source":"jobs/front.nomad.ctmpl","Wait":{"Enabled":false,"Min":0,"Max":0},"LeftDelim":"\u003c%","RightDelim":"%\u003e"}],"Vault":{"Address":"","Enabled":false,"Grace":300000000000,"RenewToken":true,"Retry":{"Attempts":12,"Backoff":250000000,"MaxBackoff":60000000000,"Enabled":true},"SSL":{"CaCert":"","CaPath":"","Cert":"","Enabled":true,"Key":"","ServerName":"","Verify":true},"Transport":{"DialKeepAlive":30000000000,"DialTimeout":30000000000,"DisableKeepAlives":false,"IdleConnTimeout":90000000000,"MaxIdleConns":100,"MaxIdleConnsPerHost":9,"TLSHandshakeTimeout":10000000000},"UnwrapToken":false},"Wait":{"Enabled":false,"Min":0,"Max":0}}
2017/09/08 12:42:35.930841 [INFO] (runner) creating watcher
2017/09/08 12:42:35.931047 [INFO] (runner) starting
2017/09/08 12:42:35.931068 [DEBUG] (runner) running initial templates
2017/09/08 12:42:35.931071 [INFO] (runner) initiating run
2017/09/08 12:42:35.931107 [DEBUG] (runner) checking template c7344e2b39eacb0644f6bfef038523b3
2017/09/08 12:42:35.931582 [DEBUG] (runner) rendering "jobs/front.nomad.ctmpl" => "jobs.dev.rendered/front.nomad"
2017/09/08 12:42:35.931916 [DEBUG] (runner) diffing and updating dependencies
2017/09/08 12:42:35.931929 [DEBUG] (runner) watching 0 dependencies

Expected behavior

consul-template should exit

Actual behavior

consul-template is still running

Steps to reproduce

1. 2. 3.

References

Are there any other GitHub issues (open or closed) that should be linked here? For example:

mildred commented 7 years ago

Note that this is not always the case. Sometimes consul-template just exits nicely.

sethvargo commented 7 years ago

GH-1000

mildred commented 7 years ago

Thank you. So it works indeed with version 0.19.0