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.71k stars 9.55k forks source link

panic: runtime error: invalid memory address or nil pointer dereference #23600

Closed FernandoMiguel closed 4 years ago

FernandoMiguel commented 4 years ago

Terraform Version

Terraform v0.12.17
terragrunt version v0.21.8

Terraform Configuration Files

We have crash.log that can make available encrypted with hashicorp gpg key to the developer looking into this issue.

Crash Output

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x1abc633]
goroutine 1458 [running]:
github.com/hashicorp/terraform/terraform.(*evaluationStateData).getResourceInstancesAll(0xc0016af560, 0x4d, 0xc00048e600, 0x13, 0xc0004e23ea, 0x5, 0xc0003f9e78, 0x6, 0x1b, 0xb, ...)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/terraform/evaluate.go:724 +0x483
github.com/hashicorp/terraform/terraform.(*evaluationStateData).GetResource(0xc0016af560, 0x4d, 0xc00048e600, 0x13, 0xc0004e23ea, 0x5, 0xc0003f9e78, 0x6, 0x1b, 0xb, ...)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/terraform/evaluate.go:560 +0x85a
github.com/hashicorp/terraform/lang.(*Scope).evalContext(0xc00155cfa0, 0xc00144a1e0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x3dddb01, 0x28)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/lang/eval.go:278 +0x2d2c
github.com/hashicorp/terraform/lang.(*Scope).EvalContext(...)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/lang/eval.go:160
github.com/hashicorp/terraform/lang.(*Scope).EvalExpr(0xc00155cfa0, 0x2ed2920, 0xc000149ce0, 0x2ed3ae0, 0x3e30570, 0x0, 0xc001192500, 0xc001192680, 0x10cb161, 0xc00004c180, ...)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/lang/eval.go:87 +0xb3
github.com/hashicorp/terraform/terraform.(*BuiltinEvalContext).EvaluateExpr(0xc0013b3930, 0x2ed2920, 0xc000149ce0, 0x2ed3ae0, 0x3e30570, 0x0, 0x0, 0x45, 0x3c000, 0x45, ...)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/terraform/eval_context_builtin.go:279 +0x1e2
github.com/hashicorp/terraform/terraform.(*EvalWriteOutput).Eval(0xc00179a960, 0x2f03f20, 0xc0013b3930, 0x2, 0x2, 0x0, 0xc0011dc400)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/terraform/eval_output.go:48 +0x152
github.com/hashicorp/terraform/terraform.EvalRaw(0x2e90700, 0xc00179a960, 0x2f03f20, 0xc0013b3930, 0x2d, 0x0, 0x0, 0x2d)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/terraform/eval.go:57 +0x131
github.com/hashicorp/terraform/terraform.(*EvalOpFilter).Eval(0xc00179a990, 0x2f03f20, 0xc0013b3930, 0x2, 0x2, 0x2ae7b70, 0x10000c01f53ab28)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/terraform/eval_filter_operation.go:37 +0x4c
github.com/hashicorp/terraform/terraform.EvalRaw(0x2e904a0, 0xc00179a990, 0x2f03f20, 0xc0013b3930, 0x0, 0xc001192d08, 0xc0000b8000, 0x2d)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/terraform/eval.go:57 +0x131
github.com/hashicorp/terraform/terraform.(*EvalSequence).Eval(0xc000d5dea0, 0x2f03f20, 0xc0013b3930, 0x2, 0x2, 0x1aaab65, 0x2e904a0)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/terraform/eval_sequence.go:20 +0xfd
github.com/hashicorp/terraform/terraform.EvalRaw(0x2e90600, 0xc000d5dea0, 0x2f03f20, 0xc0013b3930, 0x26e10c0, 0x3cd4c44, 0x264ae00, 0xc0013c40c0)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/terraform/eval.go:57 +0x131
github.com/hashicorp/terraform/terraform.Eval(0x2e90600, 0xc000d5dea0, 0x2f03f20, 0xc0013b3930, 0xc000d5dea0, 0x2e90600, 0xc000d5dea0, 0x0)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/terraform/eval.go:35 +0x4d
github.com/hashicorp/terraform/terraform.(*Graph).walk.func1(0x28b9860, 0xc001906d80, 0x0, 0x0, 0x0)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/terraform/graph.go:90 +0xf7e
github.com/hashicorp/terraform/dag.(*Walker).walkVertex(0xc000e69700, 0x28b9860, 0xc001906d80, 0xc000dcbcc0)
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/dag/walk.go:392 +0x377
created by github.com/hashicorp/terraform/dag.(*Walker).Update
    /private/tmp/terraform-20191202-72197-c1gb10/terraform-0.12.17/src/github.com/hashicorp/terraform/dag/walk.go:314 +0xaa7

Expected Behavior

Actual Behavior

Steps to Reproduce

jbardin commented 4 years ago

Duplicate of #23522

ghost commented 4 years 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.