Closed relifeted closed 5 years ago
Thanks for the bug report @relifeted,
There seems to be an unexpectedly nil instance in the state. The relevant stack trace is:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x1ad1ff3]
goroutine 2298 [running]:
github.com/hashicorp/terraform/terraform.(*evaluationStateData).getResourceInstancesAll(0xc0068413b0, 0x4d, 0xc000702820, 0x13, 0xc000948d40, 0xd, 0xc0007f6180, 0x33, 0xa, 0x1a, ...)
/opt/gopath/src/github.com/hashicorp/terraform/terraform/evaluate.go:704 +0x11a3
github.com/hashicorp/terraform/terraform.(*evaluationStateData).GetResourceInstance(0xc0068413b0, 0x4d, 0xc000702820, 0x13, 0xc000948d40, 0xd, 0x0, 0x0, 0xc0007f6180, 0x33, ...)
/opt/gopath/src/github.com/hashicorp/terraform/terraform/evaluate.go:593 +0x1360
github.com/hashicorp/terraform/lang.(*Scope).evalContext(0xc003bec5f0, 0xc001848fa0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0xc00089b520, 0xa)
/opt/gopath/src/github.com/hashicorp/terraform/lang/eval.go:253 +0xfcc
github.com/hashicorp/terraform/lang.(*Scope).EvalContext(...)
/opt/gopath/src/github.com/hashicorp/terraform/lang/eval.go:160
github.com/hashicorp/terraform/lang.(*Scope).EvalExpr(0xc003bec5f0, 0x2de8f60, 0xc000417e00, 0x2dea2a0, 0x3ee48d8, 0xc0014caa80, 0x0, 0xc0020c8768, 0x3, 0xc00004e570, ...)
/opt/gopath/src/github.com/hashicorp/terraform/lang/eval.go:87 +0xb3
github.com/hashicorp/terraform/terraform.(*BuiltinEvalContext).EvaluateExpr(0xc0014c95f0, 0x2de8f60, 0xc000417e00, 0x2dea2a0, 0x3ee48d8, 0x0, 0x0, 0x3ec4c60, 0x56, 0x2a30f70, ...)
/opt/gopath/src/github.com/hashicorp/terraform/terraform/eval_context_builtin.go:284 +0x1e4
github.com/hashicorp/terraform/terraform.(*EvalWriteOutput).Eval(0xc0019e23c0, 0x2e1c120, 0xc0014c95f0, 0x2, 0x2, 0xc001a20000, 0x53)
/opt/gopath/src/github.com/hashicorp/terraform/terraform/eval_output.go:48 +0x153
github.com/hashicorp/terraform/terraform.EvalRaw(0x2da8d20, 0xc0019e23c0, 0x2e1c120, 0xc0014c95f0, 0x3e, 0x0, 0x0, 0x3e)
/opt/gopath/src/github.com/hashicorp/terraform/terraform/eval.go:57 +0x131
github.com/hashicorp/terraform/terraform.(*EvalOpFilter).Eval(0xc0019e2420, 0x2e1c120, 0xc0014c95f0, 0x2, 0x2, 0xc0020c8b38, 0x102b231)
/opt/gopath/src/github.com/hashicorp/terraform/terraform/eval_filter_operation.go:37 +0x4c
github.com/hashicorp/terraform/terraform.EvalRaw(0x2da8ae0, 0xc0019e2420, 0x2e1c120, 0xc0014c95f0, 0x14, 0xbf3b4a942b5c4bc8, 0x626428c9b, 0x3e)
/opt/gopath/src/github.com/hashicorp/terraform/terraform/eval.go:57 +0x131
github.com/hashicorp/terraform/terraform.(*EvalSequence).Eval(0xc000c9ff40, 0x2e1c120, 0xc0014c95f0, 0x2, 0x2, 0x1abe1c5, 0x2da8ae0)
/opt/gopath/src/github.com/hashicorp/terraform/terraform/eval_sequence.go:20 +0xfd
github.com/hashicorp/terraform/terraform.EvalRaw(0x2da8c20, 0xc000c9ff40, 0x2e1c120, 0xc0014c95f0, 0x2663a20, 0x3d9a404, 0x25d0da0, 0xc00148edb0)
/opt/gopath/src/github.com/hashicorp/terraform/terraform/eval.go:57 +0x131
github.com/hashicorp/terraform/terraform.Eval(0x2da8c20, 0xc000c9ff40, 0x2e1c120, 0xc0014c95f0, 0xc000c9ff40, 0x2da8c20, 0xc000c9ff40, 0x0)
/opt/gopath/src/github.com/hashicorp/terraform/terraform/eval.go:35 +0x4d
github.com/hashicorp/terraform/terraform.(*Graph).walk.func1(0x282c680, 0xc000a6a030, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hashicorp/terraform/terraform/graph.go:90 +0xf40
github.com/hashicorp/terraform/dag.(*Walker).walkVertex(0xc0007be980, 0x282c680, 0xc000a6a030, 0xc0015b47c0)
/opt/gopath/src/github.com/hashicorp/terraform/dag/walk.go:392 +0x353
created by github.com/hashicorp/terraform/dag.(*Walker).Update
/opt/gopath/src/github.com/hashicorp/terraform/dag/walk.go:314 +0xa9b
@jbardin I think it's a dupe of another issue I have opened #21740 . Do you think this will be fixed in the 0.11.x series?
closed by #21979
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 Configuration Files
Debug Output
https://gist.github.com/relifeted/c831f9521d8228c94ecd4deaa4996da4
Crash Output
https://gist.github.com/relifeted/c831f9521d8228c94ecd4deaa4996da4
Expected Behavior
finish plan
Actual Behavior
crashed
Steps to Reproduce
terraform init
terraform plan
Additional Context
References