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

Panic on plan after upgrade to 0.12 #21407

Closed
infonaut opened this issue May 23, 2019 · 12 comments
Closed

Panic on plan after upgrade to 0.12 #21407

infonaut opened this issue May 23, 2019 · 12 comments

Comments

@infonaut
Copy link

Terraform Version

Terraform v0.12.0
+ provider.aws v2.10.0
+ provider.template v2.1.2

Debug Output

Encrypted gist: https://gist.github.com/infonaut/b83d841911f9f1c5c0434f10136c430d

Crash Output

Encrypted gist: https://gist.github.com/infonaut/3b490542e6e1237429d4a3ed2b377ed0

Actual Behavior

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x1ab148e]

goroutine 2399 [running]:
github.com/hashicorp/terraform/terraform.(*NodeAbstractResourceInstance).References(0xc000c40410, 0x0, 0x0, 0x0)
	/private/tmp/terraform-20190523-61862-1w2ypr9/terraform-0.12.0/src/github.com/hashicorp/terraform/terraform/node_resource_abstract.go:241 +0xae
github.com/hashicorp/terraform/terraform.NewReferenceMap(0xc00178f400, 0x231, 0x231, 0x231)
	/private/tmp/terraform-20190523-61862-1w2ypr9/terraform-0.12.0/src/github.com/hashicorp/terraform/terraform/transform_reference.go:402 +0x24a
github.com/hashicorp/terraform/terraform.(*ReferenceTransformer).Transform(0x3c7e578, 0xc001f6fc70, 0x14, 0x0)
	/private/tmp/terraform-20190523-61862-1w2ypr9/terraform-0.12.0/src/github.com/hashicorp/terraform/terraform/transform_reference.go:73 +0x71
github.com/hashicorp/terraform/terraform.(*BasicGraphBuilder).Build(0xc00098fce0, 0x0, 0x0, 0x0, 0x3c5e920, 0xc001dcfd10, 0x10e2760, 0xc0000d0000)
	/private/tmp/terraform-20190523-61862-1w2ypr9/terraform-0.12.0/src/github.com/hashicorp/terraform/terraform/graph_builder.go:50 +0x477
github.com/hashicorp/terraform/terraform.(*PlanGraphBuilder).Build(0xc00292ddc0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x24e86a0, 0xc0013d4f00)
	/private/tmp/terraform-20190523-61862-1w2ypr9/terraform-0.12.0/src/github.com/hashicorp/terraform/terraform/graph_builder_plan.go:65 +0xbc
github.com/hashicorp/terraform/terraform.(*Context).Graph(0xc000190000, 0x2854703, 0xc001dcfd66, 0xc000190000, 0xc00029cce0, 0x3c7e578, 0xc001822480)
	/private/tmp/terraform-20190523-61862-1w2ypr9/terraform-0.12.0/src/github.com/hashicorp/terraform/terraform/context.go:292 +0x1b8
github.com/hashicorp/terraform/terraform.(*Context).Plan(0xc000190000, 0x0, 0x0, 0x0, 0x0)
	/private/tmp/terraform-20190523-61862-1w2ypr9/terraform-0.12.0/src/github.com/hashicorp/terraform/terraform/context.go:546 +0x566
github.com/hashicorp/terraform/backend/local.(*Local).opPlan.func2(0xc001478b40, 0xc000190000, 0xc0000c37c0, 0xc00250e740)
	/private/tmp/terraform-20190523-61862-1w2ypr9/terraform-0.12.0/src/github.com/hashicorp/terraform/backend/local/backend_plan.go:105 +0x83
created by github.com/hashicorp/terraform/backend/local.(*Local).opPlan
	/private/tmp/terraform-20190523-61862-1w2ypr9/terraform-0.12.0/src/github.com/hashicorp/terraform/backend/local/backend_plan.go:102 +0x4af

Does not appear to be a provider issue.

@mildwonkey
Copy link
Contributor

Hey @infonaut ! I think you have the honor of reporting the first 0.12.0 crash - THANK YOU for the report 😁 (and I am sorry that it happened!)

I need a little more information to start looking at this - can you please include your terraform configuration files (or at least enough for us to reproduce the issue locally)?

I presume that this is encrypted with the public [email protected] key; please speak up if I am mistaken.

Thanks again, and I'm sorry you ran into this crash!

@apparentlymart apparentlymart added this to the v0.12.1 milestone May 23, 2019
@infonaut
Copy link
Author

infonaut commented May 23, 2019

Hi. I shall take that badge of honour ;)

Yes it's the key from Keybase.

files.zip

I'm not sure how much more you need as these also use modules, which I've not included.

@mildwonkey
Copy link
Contributor

Thanks for the additional information @infonaut!
Did you use terraform 0.12upgrade to upgrade these modules? I noticed a few things that (I think) suggested they were upgraded manually but I could be mistaken.

@infonaut
Copy link
Author

Hi @mildwonkey They were upgraded with 0.12upgrade. A few things had to be done by hand. For example, a flatten on a list of security groups inside a list of security groups.

@invidian
Copy link
Contributor

crash.zip

It seems that I also hit this issue. I uploaded state file, which allows to reproduce the crash if you run terraform destroy.

@apparentlymart
Copy link
Contributor

I think #21445 is a fix for this.

@nauxliu
Copy link

nauxliu commented May 27, 2019

Will this be fixed in v0.12.1? we were bitten by this too.

@mildwonkey
Copy link
Contributor

@nauxliu and @infonaut:
I believe this is fixed by #21445, but this is a particularly difficult situation to reproduce. If either of you would like to test the fix immediately - and this is entirely up to you - you could build terraform from master. Again, I will leave that up to you; the fix will be included in v0.12.1.

@nauxliu
Copy link

nauxliu commented May 31, 2019

@mildwonkey I have tried a build from the master and this crash is gone, But now I'm running into another crash #21396

@mildwonkey
Copy link
Contributor

Thanks, I really appreciate your help testing that @nauxliu!

I'll close this issue, and we will get to work on the next one :)

@infonaut
Copy link
Author

Salute to you @nauxliu that was a quick build and test!

@mildwonkey for me however this build worked and did not cause a crash.

Thanks!

@ghost
Copy link

ghost commented Jul 25, 2019

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 Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants