hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.35k stars 9.49k forks source link

AttributeTypes on non-object Type goroutine 649 #33568

Closed sdhonju closed 1 year ago

sdhonju commented 1 year ago

Terraform Version

Terraform v1.1.2
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v5.9.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
+ provider registry.terraform.io/hashicorp/time v0.9.1

Terraform Configuration Files

https://github.com/sdhonju/opensearch

Debug Output

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform crashed! This is always indicative of a bug within Terraform. Please report the crash with Terraform1 so that we can fix this.

When reporting bugs, please include your terraform version, the stack trace shown below, and any additional information which may help replicate the issue.

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

AttributeTypes on non-object Type goroutine 649 [running]: runtime/debug.Stack() /usr/local/go/src/runtime/debug/stack.go:24 +0x65 runtime/debug.PrintStack() /usr/local/go/src/runtime/debug/stack.go:16 +0x19 github.com/hashicorp/terraform/internal/logging.PanicHandler() /Users/distiller/project/project/internal/logging/panic.go:55 +0x154 panic({0x2d2bb00, 0x3600bb0}) /usr/local/go/src/runtime/panic.go:1038 +0x215 github.com/zclconf/go-cty/cty.Type.AttributeTypes(...) /Users/distiller/go/pkg/mod/github.com/zclconf/go-cty@v1.10.0/cty/object_type.go:187 github.com/zclconf/go-cty/cty/convert.unifyObjectTypesToMap({0xc0103fd420, 0x2, 0x36819e8}, 0x1) /Users/distiller/go/pkg/mod/github.com/zclconf/go-cty@v1.10.0/cty/convert/unify.go:368 +0x599 github.com/zclconf/go-cty/cty/convert.unifyTupleTypesToList({0xc0103fd420, 0x2, 0x2}, 0x1) /Users/distiller/go/pkg/mod/github.com/zclconf/go-cty@v1.10.0/cty/convert/unify.go:487 +0x433 github.com/zclconf/go-cty/cty/convert.unifyTupleTypes({0xc0103fd420, 0x3, 0x3}, 0x1, 0xd2) /Users/distiller/go/pkg/mod/github.com/zclconf/go-cty@v1.10.0/cty/convert/unify.go:418 +0x69b github.com/zclconf/go-cty/cty/convert.unify({0xc0103fd420, 0x2, 0x2}, 0x1) /Users/distiller/go/pkg/mod/github.com/zclconf/go-cty@v1.10.0/cty/convert/unify.go:85 +0x41e github.com/zclconf/go-cty/cty/convert.UnifyUnsafe(...) /Users/distiller/go/pkg/mod/github.com/zclconf/go-cty@v1.10.0/cty/convert/public.go:82 github.com/hashicorp/hcl/v2/hclsyntax.(ConditionalExpr).Value(0xc0004fe4d0, 0xc00dd93e90) /Users/distiller/go/pkg/mod/github.com/hashicorp/hcl/v2@v2.11.1/hclsyntax/expression.go:609 +0x2bd github.com/hashicorp/terraform/internal/lang.(Scope).EvalExpr(0xc00ddc3140, {0x3680590, 0xc0004fe4d0}, {{0x36819b0, 0x4b68328}}) /Users/distiller/project/project/internal/lang/eval.go:171 +0x14b github.com/hashicorp/terraform/internal/terraform.(nodeModuleVariable).evalModuleCallArgument(0xc00ddc3080, {0x36f59a0, 0xc0006200e0}, 0x37) /Users/distiller/project/project/internal/terraform/node_module_variable.go:234 +0x21f github.com/hashicorp/terraform/internal/terraform.(nodeModuleVariable).Execute(0xc00ddc3080, {0x36f59a0, 0xc0006200e0}, 0x0) /Users/distiller/project/project/internal/terraform/node_module_variable.go:158 +0x74 github.com/hashicorp/terraform/internal/terraform.(ContextGraphWalker).Execute(0xc000bac460, {0x36f59a0, 0xc0006200e0}, {0x2fb86b38, 0xc00ddc3080}) /Users/distiller/project/project/internal/terraform/graph_walk_context.go:133 +0xc2 github.com/hashicorp/terraform/internal/terraform.(Graph).walk.func1({0x2fa1900, 0xc00ddc3080}) /Users/distiller/project/project/internal/terraform/graph.go:74 +0x2f0 github.com/hashicorp/terraform/internal/dag.(Walker).walkVertex(0xc00ddc30e0, {0x2fa1900, 0xc00ddc3080}, 0xc00c3fd980) /Users/distiller/project/project/internal/dag/walk.go:381 +0x2f1 created by github.com/hashicorp/terraform/internal/dag.(Walker).Update /Users/distiller/project/project/internal/dag/walk.go:304 +0xf85 ERRO[0007] 1 error occurred:

Expected Behavior

deploy opensearch in vpc

Actual Behavior

Terraform crash

Steps to Reproduce

1) cd opensearch_test2/core 2) terragrunt init 3) terragrunt plan

Additional Context

use Terragrunt as a wrapper Terragrunt version: v0.35.6

References

No response

jbardin commented 1 year ago

Hi @sdhonju,

Thanks for filing the issue. There have been numerous bugs fixed in the years since v1.1 was released, can you confirm that you still have the same issue with a current version of Terraform? If so, the stack trace and a gist of the log output from TF_LOG_CORE=trace would help with diagnosing the problem.

Thanks!

sdhonju commented 1 year ago

hi @Jbardin, Thanks for your response. I've attached the output of the TF_LOG_CORE. Please let me know if that is helpful.

Regards!

apply.txt

jbardin commented 1 year ago

Thanks @sdhonju, can you also test with the current release of Terraform so we can rule out if the issue has been fixed since v1.1 was released?

sdhonju commented 1 year ago

@jbardin, That did the trick. I tried it with terraform ver 1.3 and was able to succesfully run the apply.

thank you

github-actions[bot] commented 9 months ago

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.