lura icon indicating copy to clipboard operation
lura copied to clipboard

Validation of flexible configuration fails silently if template is missing

Open thmshmm opened this issue 5 years ago • 2 comments

Describe the bug If you configure KrakenD to use flexible configuration and split the config into multiple templates there is no ouput in case the template file name is spelled incorrect.

To Reproduce Steps to reproduce the behavior:

  1. Configuration used Create a flexible configuration with at least one template (e.g. test.tmpl). Include the template with {{ template "test.tmpl" context }} works as expected. Including a non existent template {{ template "test2.tmpl" context }} fails silently.

  2. Steps to run the software docker run --rm -e FC_ENABLE=1 -e FC_SETTINGS=/etc/krakend/settings -e FC_PARTIALS=/etc/krakend/partials -e FC_TEMPLATES=/etc/krakend/templates -v $(PWD)/krakend:/etc/krakend devopsfaith/krakend:1.1.1-alpine check -d -c /etc/krakend/krakend.json

Expected behavior At least some output like file not found should be printed to support debugging.

Logs Only output is: Parsing configuration file: /etc/krakend/krakend.json

Additional context Add any other context about the problem here.

thmshmm avatar Mar 25 '20 09:03 thmshmm

That is my last hour. -.-"

Frontrider avatar Oct 12 '20 14:10 Frontrider

Not even just the template. I use none of them, and I still have an error with absolutely no information, and if I look at the docs I'm supposed to be fine.

Frontrider avatar Oct 12 '20 14:10 Frontrider

This issue was solved years ago, thanks for reporting. Including an unexisting template throws something like this:

Found error while executing template:template: krakend.tmpl:10:15: executing "krakend.tmpl"
at <{{template "aaaaaaaaaaaaaaaaaa.tmpl" "file.json"}}>: template "aaaaaaaaaaaaaaaaaa.tmpl" not defined

alombarte avatar Sep 28 '23 11:09 alombarte

This issue was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.

github-actions[bot] avatar Dec 28 '23 00:12 github-actions[bot]