You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to generate Nginx configuration files dynamically based on service metadata stored in Consul. Our consul-template renders tagged services and generates upstream configurations.
Templating is triggered by changes in consul catalog and on each trigger, all ~200 available services are fetched and only ~130 tagged ones are rendered.
For a simplicity, I created a small environment with only 2 tagged services and here is the trace.log.
Problem
Found a bug while extending our template with plugin which triggers a python script for moving decommissioned sites .conf files to a folder.
// Fire an initial run to parse all the templates and setup the first-pass// dependencies. This also forces any templates that have no dependencies to// be rendered immediately (since they are already renderable).log.Printf("[DEBUG] (runner) running initial templates")
iferr:=r.Run(); err!=nil {
r.ErrCh<-errreturn
}
Use some way of writing every consul-template rendering output to a new file using a python script or template itself
My results consistently show the same pattern: an initial empty file followed by a correct file rendered within the same run. After that, consul-template continues to run and render normally.
-rw-r--r-- 1 www-data adm 1 Nov 1 08:24 fqdn_list_20241101_082414.txt
-rw-r--r-- 1 www-data adm 39 Nov 1 08:24 fqdn_list_20241101_082415.txt
...
-rw-r--r-- 1 www-data adm 39 Nov 1 12:42 fqdn_list_20241101_124244.txt
-rw-r--r-- 1 www-data adm 39 Nov 1 12:43 fqdn_list_20241101_124335.txt
Also, using --wait seems to have no impact on initial run.
The text was updated successfully, but these errors were encountered:
Version
v0.39.1
We are using
consul-template
in Exec mode:to generate Nginx configuration files dynamically based on service metadata stored in Consul. Our consul-template renders tagged services and generates upstream configurations.
Templating is triggered by changes in consul catalog and on each trigger, all ~200 available services are fetched and only ~130 tagged ones are rendered.
For a simplicity, I created a small environment with only 2 tagged services and here is the trace.log.
Problem
Found a bug while extending our template with plugin which triggers a python script for moving decommissioned sites
.conf
files to a folder.Upon restarting the ssl-proxy service or running consul-template first time even through CLI:
the initial fetch cycle renders with empty data.
Looking at the code:
and some other issues:
gaves ma an idea of a first-pass run but I cannot really figure out why is this happening when there is a successful response with all services:
before the first rendering:
Steps to reproduce
My results consistently show the same pattern: an initial empty file followed by a correct file rendered within the same run. After that,
consul-template
continues to run and render normally.Also, using
--wait
seems to have no impact on initial run.The text was updated successfully, but these errors were encountered: