-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using undefined variables in task config produces useless error #5694
Labels
Comments
notnoop
pushed a commit
to hashicorp/hcl2
that referenced
this issue
Jun 17, 2019
Fix a bug where diagnostics found when evaluating array individual elements are ignored, resulting in suppressed errors. Nomad observed this issue in hashicorp/nomad#5694.
notnoop
pushed a commit
to hashicorp/hcl2
that referenced
this issue
Jun 17, 2019
Fix a bug where diagnostics found when evaluating array individual elements are ignored, resulting in suppressed errors. Nomad observed this issue in hashicorp/nomad#5694.
notnoop
pushed a commit
that referenced
this issue
Jun 17, 2019
This upgrades hcl2 library dependency to pick up hashicorp/hcl2#113 . Prior to this change, parsing and decoding array attributes containing invalid errors (e.g. references to unknown variables) are silently dropped, with `cty.Unknown` being assigned to the bad element. Rather than showing a type/meaningful error from hcl2, we get a very decrypted error message from msgpack layer trying to handle `cty.unknown`. This ensures that we propagate diagnostics correctly and report meaningful errors to users. Fixes #5694 Fixes #5680
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Nomad version
0.9.0 and 0.9.1
Issue
Using an undefined variable for interpolation in a task
config
stanza produces a useless error message. For example${FOO_bar}
in a Dockerdns_servers
list would cause the following error:The root cause seems to be that undefined variables are defined as Unknown in HCL2:
Reproduction steps
Use an undefined variable in a task config.
Job file (if appropriate)
The text was updated successfully, but these errors were encountered: