-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
provider version constraint with interpolation causes panic #15742
Comments
Thanks for reporting this, @blalor. Indeed this should be a proper error message, rather than a panic. There is supposed to be some earlier code that validates the config before we reach this point, but evidently it's not getting run for some reason and so I imagine this crash would apply for any invalid version constraint string. As an aside, this message in your log is surprising to me:
This file is supposed to be created by |
I actually hadn't run
Removing the If I then add the |
interpolation appears to work on all provider attributes except for the version attribute. |
Just wanted to add second (or third) voice to this w/log: this panic does seem to happen for any bad version constraint, given, e.g. provider "aws" {
region = "us-east-1"
version = "~1.3"
} ...you might get a crash log like the one attached: crash.log Not a huge problem, of course. The panic makes the intended effect but contradicts the all-caps warnings. |
Thanks for the updates here everyone, and sorry for the silence. Based on what @blalor reported, it sounds like the code that deals with checking that all the constraints are met when running any command other than
Probably some things are just happening in the wrong order here. I'll take a look and find the right place to insert the required validation check here so we can produce the expected error message in all cases. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
Terraform v0.10.0
Terraform Configuration Files
Debug Output
crash.log.txt
Panic Output
See debug output above.
Expected Behavior
A user-friendly error should have been displayed indicating that the version constraint is invalid. Eventually it would be great to be able to specify provider versions via a variable, so that they can be defined consistently across modules.
Actual Behavior
Panic on
terraform plan
.Steps to Reproduce
terraform plan
The text was updated successfully, but these errors were encountered: