Skip to content
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

command: Fix crash caused by empty state (data source PostApply) #12370

Merged
merged 1 commit into from
Mar 2, 2017

Conversation

radeksimko
Copy link
Member

Apparently I didn't test #12261 thoroughly on data sources. 😢

cc @mitchellh This should be reviewed & merged prior to the next release.

data.google_compute_zones.available: Destroying... (ID: 2017-03-0...0000 UTC)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4693629]

goroutine 489 [running]:
github.com/hashicorp/terraform/command.(*UiHook).PostApply(0xc4201c41e0, 0xc420017b30, 0x0, 0x0, 0x0, 0x18, 0xc4204e3360, 0x0)
	/Users/radeksimko/gopath/src/github.com/hashicorp/terraform/command/hook_ui.go:203 +0x119
github.com/hashicorp/terraform/terraform.(*EvalApplyPost).Eval.func1(0x7d8e300, 0xc4201c41e0, 0xed049efa6, 0xc420278000, 0x2c)
	/Users/radeksimko/gopath/src/github.com/hashicorp/terraform/terraform/eval_apply.go:142 +0x5b
github.com/hashicorp/terraform/terraform.(*BuiltinEvalContext).Hook(0xc42014d0a0, 0xc4204e3360, 0x2c, 0x0)
	/Users/radeksimko/gopath/src/github.com/hashicorp/terraform/terraform/eval_context_builtin.go:61 +0x6c
github.com/hashicorp/terraform/terraform.(*EvalApplyPost).Eval(0xc4204e2b00, 0x7d8fd80, 0xc42014d0a0, 0x2, 0x2, 0x56aa7fd, 0x4)
	/Users/radeksimko/gopath/src/github.com/hashicorp/terraform/terraform/eval_apply.go:143 +0xa7
github.com/hashicorp/terraform/terraform.EvalRaw(0x7d5da80, 0xc4204e2b00, 0x7d8fd80, 0xc42014d0a0, 0x5331c40, 0x0, 0x0, 0x0)
	/Users/radeksimko/gopath/src/github.com/hashicorp/terraform/terraform/eval.go:53 +0x175
github.com/hashicorp/terraform/terraform.(*EvalSequence).Eval(0xc4204e2b60, 0x7d8fd80, 0xc42014d0a0, 0x2, 0x2, 0x56aa7fd, 0x4)
	/Users/radeksimko/gopath/src/github.com/hashicorp/terraform/terraform/eval_sequence.go:14 +0xc1
github.com/hashicorp/terraform/terraform.EvalRaw(0x7d5e380, 0xc4204e2b60, 0x7d8fd80, 0xc42014d0a0, 0x2b, 0x0, 0x0, 0x2b)
	/Users/radeksimko/gopath/src/github.com/hashicorp/terraform/terraform/eval.go:53 +0x175
github.com/hashicorp/terraform/terraform.(*EvalOpFilter).Eval(0xc4204a7f50, 0x7d8fd80, 0xc42014d0a0, 0x2, 0x2, 0x56aa7fd, 0x4)
	/Users/radeksimko/gopath/src/github.com/hashicorp/terraform/terraform/eval_filter_operation.go:37 +0x4c
github.com/hashicorp/terraform/terraform.EvalRaw(0x7d5e140, 0xc4204a7f50, 0x7d8fd80, 0xc42014d0a0, 0x4d7bb40, 0xc4201bd11c, 0x4afdc80, 0xc4201bd140)
	/Users/radeksimko/gopath/src/github.com/hashicorp/terraform/terraform/eval.go:53 +0x175
github.com/hashicorp/terraform/terraform.Eval(0x7d5e140, 0xc4204a7f50, 0x7d8fd80, 0xc42014d0a0, 0xc4204a7f50, 0x7d5e140, 0xc4204a7f50, 0xc42068e340)
	/Users/radeksimko/gopath/src/github.com/hashicorp/terraform/terraform/eval.go:34 +0x4d
github.com/hashicorp/terraform/terraform.(*Graph).walk.func1(0x5524ac0, 0xc42000c570, 0x0, 0x0)
	/Users/radeksimko/gopath/src/github.com/hashicorp/terraform/terraform/graph.go:126 +0xd4d
github.com/hashicorp/terraform/dag.(*Walker).walkVertex(0xc42096ed90, 0x5524ac0, 0xc42000c570, 0xc420554240)
	/Users/radeksimko/gopath/src/github.com/hashicorp/terraform/dag/walk.go:387 +0x392
created by github.com/hashicorp/terraform/dag.(*Walker).Update
	/Users/radeksimko/gopath/src/github.com/hashicorp/terraform/dag/walk.go:310 +0x9ca

Repro case & test plan

provider "google" {
...
}

data "google_compute_zones" "available" {}
terraform apply && terraform destroy -force

@radeksimko radeksimko changed the title command: Fix crash caused by empty state command: Fix crash caused by empty state (data source PostApply) Mar 2, 2017
@mitchellh mitchellh merged commit dd8a93e into master Mar 2, 2017
@mitchellh mitchellh deleted the b-hook-ui-fix branch March 2, 2017 17:20
@ghost
Copy link

ghost commented Apr 16, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants