-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
"inconsistent set element types" crash #31978
Comments
Hi @smelchior, Thanks for filing the issue. I'm not able to replicate the crash from the example given. Could you supply the exact value being assigned to the Thanks! |
Hi @jbardin, |
Thanks @smelchior, that is a great example! We'll take a look. |
Hi @smelchior, The root problem in the configuration here is the root module variable declaration. Because you specified a type of Removing the This still should not crash however, so we can work on that upstream, and hopefully return a more reasonable error to help diagnose the problem more easily. |
Thanks for looking into it! |
@jbardin Commenting here because you closed #32048 as a duplicate. I understand your rationale regarding conversion to Can you provide a workaround for |
@Nuru, it is the |
Thank you for the additional explanation. Unfortunately, #32048 is not my example, I just referenced it because I hoped it was close enough. I'm not using My example is here. You can ignore most of the
and you will get the crash. The crash is due to |
I don't think there is any guaranteed workaround which does not involve altering the input value in some way, because it is the input value type which is triggering the bug. |
Just to be clear, this is not fixed in Terraform version 1.3.4 |
Hi @Nuru, I've checked the minimal example provided for this issue and the example provided in the duplicate issue #32048 and both are now working for me. I haven't been able to reproduce your issue as I need an AWS account to run your example. I should have one soon, when I get it I'll take another look. In the meantime, could you file a new issue and include the stack trace from your crash. If you could also try and create a minimal example that doesn't require an AWS account that would speed things up for me to be able to reproduce. Either way, we'll carry on considering this issue closed and can discuss your crash further in a new issue. |
@liamcervante I opened #32163 for you, requires no providers. |
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. |
Terraform Version
Terraform Configuration Files
Debug Output
.
Expected Behavior
no crash
Actual Behavior
inconsistent set element types (cty.Object(map[string]cty.Type{"conditions":cty.Tuple([]cty.Type{cty.Object(map[string]cty.Type{"key":cty.String, "value":cty.String})}), "name":cty.String, "not_resources":cty.List(cty.String), "recovery_point_tags":cty.Object(map[string]cty.Type{"ts-backuptype":cty.String}), "resources":cty.Tuple([]cty.Type{cty.String}), "schedules":cty.List(cty.Object(map[string]cty.Type{"cold_storage_after":cty.Number, "cron_expression":cty.String, "enable_continuous_backup":cty.String, "name":cty.String, "retention_days":cty.String}))}) then cty.Object(map[string]cty.Type{"conditions":cty.Tuple([]cty.Type{cty.Object(map[string]cty.Type{"key":cty.String, "value":cty.String})}), "name":cty.String, "not_resources":cty.List(cty.String), "recovery_point_tags":cty.Object(map[string]cty.Type{"ts-backuptype":cty.String}), "resources":cty.Tuple([]cty.Type{cty.String}), "schedules":cty.List(cty.Object(map[string]cty.Type{"cold_storage_after":cty.String, "cron_expression":cty.String, "enable_continuous_backup":cty.String, "name":cty.String, "retention_days":cty.String}))}))
goroutine 31 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
/usr/local/go/src/runtime/debug/stack.go:16 +0x1c
github.com/hashicorp/terraform/internal/logging.PanicHandler()
/Users/distiller/project/project/internal/logging/panic.go:55 +0x170
panic({0x104c352e0, 0x1400149ad20})
/usr/local/go/src/runtime/panic.go:884 +0x204
github.com/zclconf/go-cty/cty.SetVal({0x140031d2280, 0x4, 0x1?})
/Users/distiller/go/pkg/mod/github.com/zclconf/[email protected]/cty/value_init.go:281 +0x608
github.com/zclconf/go-cty/cty.transform({0x0?, 0x0, 0x0}, {{{0x105039f78?, 0x14001479280?}}, {0x104f49d60?, 0x14003856a50?}}, {0x105021360, 0x14000634390})
/Users/distiller/go/pkg/mod/github.com/zclconf/[email protected]/cty/walk.go:177 +0xbe0
github.com/zclconf/go-cty/cty.TransformWithTransformer(...)
/Users/distiller/go/pkg/mod/github.com/zclconf/[email protected]/cty/walk.go:130
github.com/hashicorp/hcl/v2/ext/typeexpr.(*Defaults).Apply(0x140008297e0?, {{{0x105039f78?, 0x14001479280?}}, {0x104f49d60?, 0x14003856a50?}})
/Users/distiller/go/pkg/mod/github.com/hashicorp/hcl/[email protected]/ext/typeexpr/defaults.go:38 +0x9c
github.com/hashicorp/terraform/internal/terraform.prepareFinalInputVariableValue({{0x14000ab2a60, 0x1, 0x1}, {{}, {0x1400039eaf0, 0xc}}}, 0x14003f15a30, 0x1400077a750)
/Users/distiller/project/project/internal/terraform/eval_variable.go:98 +0x88c
github.com/hashicorp/terraform/internal/terraform.(*nodeModuleVariable).evalModuleVariable(0x140036324e0?, {0x10504e2f8?, 0x140023ca1c0?}, 0xc?)
/Users/distiller/project/project/internal/terraform/node_module_variable.go:239 +0x3e4
github.com/hashicorp/terraform/internal/terraform.(*nodeModuleVariable).Execute(0x140036324e0, {0x10504e2f8, 0x140023ca1c0}, 0x2)
/Users/distiller/project/project/internal/terraform/node_module_variable.go:155 +0x100
github.com/hashicorp/terraform/internal/terraform.(*ContextGraphWalker).Execute(0x1400465e870, {0x10504e2f8, 0x140023ca1c0}, {0x1304d1a38, 0x140036324e0})
/Users/distiller/project/project/internal/terraform/graph_walk_context.go:136 +0xa8
github.com/hashicorp/terraform/internal/terraform.(*Graph).walk.func1({0x104e04d40, 0x140036324e0})
/Users/distiller/project/project/internal/terraform/graph.go:74 +0x208
github.com/hashicorp/terraform/internal/dag.(*Walker).walkVertex(0x14003632540, {0x104e04d40, 0x140036324e0}, 0x140010e6a80)
/Users/distiller/project/project/internal/dag/walk.go:381 +0x2e0
created by github.com/hashicorp/terraform/internal/dag.(*Walker).Update
/Users/distiller/project/project/internal/dag/walk.go:304 +0xbf0
Steps to Reproduce
terraform plan
Additional Context
The issue only happens if cold_storage_after is set in a schedule.
References
No response
The text was updated successfully, but these errors were encountered: