-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
0.14.2 Optional HeisenBug #27295
Comments
Hi @dolpsdw , This is optional and up to you, but if you'd like you can check out our issue reproduction repository and update the configuration in the 27295 branch. Updating the original issue comment here is also just fine. |
@mildwonkey Added Trace Logs and also happening on 0.14.0 beta2 |
Thank you for updating the example @dolpsdw , I'm able to reproduce the issue now, and confirm that it is still present in the master branch. |
Ok i thought that using transition = toset([]) will fix the bug. Changing back to 0.14.2 from docker hub fails first time but now is working?. |
For what it's worth, the error with The bug appears to be in the upstream go-cty library. I'm decently confident that terraform is sending the correct type to convert, here: terraform/terraform/node_module_variable.go Lines 241 to 255 in de114c4
But periodically, by the time we got to So on one run, that function receives this as the expected type:
vs this:
The difference is in the I'm not sure where the problem is coming from yet, just where the error occurs. Since this is a bug in the upstream library with an experimental feature, fixing it is a somewhat lower priority than other current bug work, but hopefully this explanation helps the next engineer to look at this. |
I understand Since this issue is still affecting Please consider this a friendly plea, not a demand in any way. To hopefully contribute to getting this resolved: My testing suggests the error only happens for a
Here's the variable definition for completeness.
|
Thanks for these reproduction cases! I believe this bug will be fixed if this upstream PR is merged and released: zclconf/go-cty#88. |
This change supports both the current `map(map(string)` but also `map(map(object({...})))` to unlock the ability to move towards a configuration schema that's not limited to maps of strings only. Moving the configuration to ojbects is currently blocked by an issue with making object attributes optional. hashicorp/terraform#27295
I can confirm |
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 0.14.2
Bug only appears the first time you do Terraform Validate, after Terraform Init.
(The second terraform Validate will not thorw error at validation and behaves normal)
Module Definition
Consumer
Our pipeline always do clean docker image 0.14.2 then run terraform init and terraform validate.
To reproduce the bug localy i hae to rename the ROOT folder of the main module: example/main.tf -> example2/main.tf
After renaming runing terraform validate, fail with
The given value is not suitable for child module variable "advanced_config" defined at .terraform\modules\regional-eu-central-1.code_distribution.s3_code_distro\s3_vars.tf:96,1-27: object is required.
And its because the snapshots folders does not have the optional transition set
The following code is currently not failing:
Consumer
Edit: Update Module Def and consumer code.
I tested on my home with terraform 0.14.0 -beta2 the bug is there aswell.
Atacched are the logs in trace Mode.
TerraformInitTrace.txt
TerraformValidate1Trace.txt
TerraformValidate2Trace.txt
Maybe when the graph is done the next validate process dont fail.
The text was updated successfully, but these errors were encountered: