cloudposse / atmos

👽 Terraform Orchestration Tool for DevOps. Keep environment configuration DRY with hierarchical imports of configurations, inheritance, and WAY more. Native support for Terraform and Helmfile.
https://atmos.tools
Apache License 2.0
719 stars 91 forks source link

Extra debug output for template execution errors #596

Open joberly opened 4 months ago

joberly commented 4 months ago

Describe the Feature

Provide extra template error context or debug data when internally generated templates fail to parse or execute.

Expected Behavior

When a template error occurs, return extra debug data for the template error to use as an aid to find the problematic stack or component code.

Use Case

Atmos-generated template parsing or execution failures at least sometimes result in very vague error messages like this:

template: all-atmos-sections:472: function "account" not defined

It would be beneficial if there was some extra context for this internally generated template for debug as the line number in the error message only corresponds to an internally generated template.

Describe Ideal Solution

Something like the following is probably ideal but perhaps a bit complicated:

template: all-atmos-sections:472: function "account" not defined
  in template "all-atmos-sections":
  472:         description: value for {{ account }}

Alternatives Considered

An option to dump the entire template to stderr or some kind of debug log/file would work, too.

Additional Context

No response

GabisCampana commented 4 months ago

@aknysh DEV-2148 : Extra debug output for template execution errors

osterman commented 3 months ago

@joberly please include the current behavior your experiencing. Also makes it easier to search for issues.