Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Invalid terraform template variable definitions return a cryptic error #1583

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

Closed
Tracked by #1939
deansheather opened this issue May 19, 2022 · 3 comments · Fixed by #2331
Closed
Tracked by #1939

Invalid terraform template variable definitions return a cryptic error #1583

deansheather opened this issue May 19, 2022 · 3 comments · Fixed by #2331
Assignees
Labels
api Area: HTTP API
Milestone

Comments

@deansheather
Copy link
Member

deansheather commented May 19, 2022

OS Information

  • OS: Linux
  • Architecture: amd64
  • coder --version: Coder v0.0.0-devel+c034e83 Wed May 18 23:15:19 UTC 2022
    c034e83

Steps to Reproduce

  1. Observe that the disk_size variable in the aws-linux example template has a default of 20
  2. Edit the default to ""
  3. Try to create the template and get an error at the "detecting persistent resources" step: template import provision for start: recv import provision: initialize terraform: configuration is invalid
  4. Edit the default to "asdf"
  5. Try to create the template and get the same error
  6. Edit the default value to any valid number e.g. 1000
  7. Try to create the template
  8. No error

Expected

If template authors set a default to an invalid value (e.g. they put letters in the default of a field with type = number) they should get a sensible error message.

Actual

Evil error message

Logs

Screenshot

image

Notes

Hopefully terraform is spitting out an error that we're just not displaying correctly, otherwise this will be hellish to fix.

Dean: Run terraform validate before the plan in the template import job.

@misskniss misskniss added the api Area: HTTP API label May 24, 2022
@kylecarbs kylecarbs changed the title Bug: invalid terraform template variable definitions return a cryptic error Invalid terraform template variable definitions return a cryptic error Jun 7, 2022
@tjcran
Copy link

tjcran commented Jun 13, 2022

@misskniss this is one i'd consider adding to #1939

@misskniss
Copy link

This needs someone to repro it and see if it still a problem. If not, this is likely a small ticket. If so, we should revisit the complexity.

@misskniss
Copy link

Update: Dean was able to repro this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Area: HTTP API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants