consul-template icon indicating copy to clipboard operation
consul-template copied to clipboard

Provide Additional Info About the Template that Failed to Render

Open Shackelford-Arden opened this issue 2 years ago • 5 comments

Proposal

Include at least the path to the template being rendered when logging out render failures.

Use-cases

Mainly focused on enabling better troubleshooting when templates go wrong :smile:

For tasks that have multiple template stanzas, troubleshooting which template failed to render can burn a decent amount of time.

Example of a failed template today:

Template failed: vault.read(<secret_path>): vault.read(<secret_path>): Error making API request.

Potentially helpful solution would be to include the path to the failed template in the beginning of the error:

Template **[path to template]** failed: vault.read(<secret_path>): vault.read(<secret_path>): Error making API request.

Attempted Solutions

Manually looking through potential directories and finding templates that contain mention of a particular Vault secret path.

Shackelford-Arden avatar May 02 '23 18:05 Shackelford-Arden

Hi @Shackelford-Arden and thanks for the suggestion, I think this would be very useful. I took a quick look at the code, and I believe the error comes straight from consul-template, the backing library we use for template rendering. Therefore, the change would possibly need to be made there.

jrasell avatar May 03 '23 07:05 jrasell

Hey @jrasell , appreciate the quick response here :smile:

Would you prefer then that I move this over to the consul-template project? Happy to do so if that's the preferred path for this request.

Shackelford-Arden avatar May 03 '23 13:05 Shackelford-Arden

@jrasell Just checking in on this in regards to my last question :)

Shackelford-Arden avatar Jul 13 '23 19:07 Shackelford-Arden

Hi @Shackelford-Arden if you could create this issue in the consul-template project that would be much appreciated.

nickwales avatar Apr 18 '25 13:04 nickwales

I'll do you one better and transfer this issue there.

tgross avatar Apr 18 '25 13:04 tgross