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

with multiple templates it is not clear where error happened #1957

Open EugenKon opened 4 months ago

EugenKon commented 4 months ago

Nomad version

v1.8.0

Issue

It is not clear where error happened if "job" has a few tasks with a few templates each image

Reproduction steps

nomad plan, nomad run

Expected Result

It should be clear in which template the error happened.

Actual Result

The error message is not clear.

Job file (if appropriate)

task "postgres-reindex-task" {
  template { ... }
  template { ... }
  template { ... }
}

UPD Though in the command line it is easier to understand where errors happened: image

tgross commented 4 months ago

Hi @EugenKon! That's a good call out but harder than you might expect to fix. There's basically two problems here: first is that the templates don't have names of any kind, so there's no nice way to identify which template is the problem except by maybe the order. The second problem, which is much more challenging for Nomad, is that we pass all the templates to a single consul-template runner, and the errors you're seeing are what the template runner is sending us. So to really fix this we'd need to change the behavior in consul-template.

I'm going to move this issue to the CT repo and maybe folks will have thoughts there.