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

VPC peering resource crashes #2690

Closed
preichenberger opened this issue Jul 11, 2015 · 4 comments
Closed

VPC peering resource crashes #2690

preichenberger opened this issue Jul 11, 2015 · 4 comments

Comments

@preichenberger
Copy link

the vpc peering resource crashes, if you have permissions to create a vpc peer, but not change it.

crash log: https://gist.github.com/f7bcaa5fe1d9a50992fd

@radeksimko
Copy link
Member

Thanks for the report.

Cropping out relevant part of the crash log:

2015/07/10 22:24:56 terraform-provider-aws: 2015/07/10 22:24:56 [INFO] Accept VPC Peering Connection with id: pcx-9b34fbf2
2015/07/10 22:24:56 terraform-provider-aws: panic: runtime error: invalid memory address or nil pointer dereference
2015/07/10 22:24:56 terraform-provider-aws: [signal 0xb code=0x1 addr=0x18 pc=0x11c2d8]
2015/07/10 22:24:56 terraform-provider-aws: 
2015/07/10 22:24:56 terraform-provider-aws: goroutine 234 [running]:
2015/07/10 22:24:56 terraform-provider-aws: github.com/hashicorp/terraform/builtin/providers/aws.resourceVPCPeeringConnectionAccept(0xc20874a060, 0xc2085c5330, 0xc, 0x0, 0x0, 0x0, 0x0)
2015/07/10 22:24:56 terraform-provider-aws:     /private/tmp/terraform20150702-45875-1xz55ha/terraform-0.6.0/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_peering_connection.go:131 +0x1f8
2015/07/10 22:24:56 terraform-provider-aws: github.com/hashicorp/terraform/builtin/providers/aws.resourceAwsVPCPeeringUpdate(0xc208920960, 0x6a5700, 0xc208686cf0, 0x0, 0x0)
2015/07/10 22:24:56 terraform-provider-aws:     /private/tmp/terraform20150702-45875-1xz55ha/terraform-0.6.0/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_peering_connection.go:158 +0x38d
2015/07/10 22:24:56 terraform-provider-aws: github.com/hashicorp/terraform/builtin/providers/aws.resourceAwsVPCPeeringCreate(0xc208920960, 0x6a5700, 0xc208686cf0, 0x0, 0x0)
2015/07/10 22:24:56 terraform-provider-aws:     /private/tmp/terraform20150702-45875-1xz55ha/terraform-0.6.0/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_vpc_peering_connection.go:88 +0xbfb
2015/07/10 22:24:56 terraform-provider-aws: github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc2082c06c0, 0xc208754ea0, 0xc2085c46d0, 0x6a5700, 0xc208686cf0, 0x1, 0x0, 0x0)
2015/07/10 22:24:56 terraform-provider-aws:     /private/tmp/terraform20150702-45875-1xz55ha/terraform-0.6.0/src/github.com/hashicorp/terraform/helper/schema/resource.go:145 +0x2c1
2015/07/10 22:24:56 terraform-provider-aws: github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc2088769c0, 0xc208756e40, 0xc208754ea0, 0xc2085c46d0, 0x6a68a0, 0x0, 0x0)
2015/07/10 22:24:56 terraform-provider-aws:     /private/tmp/terraform20150702-45875-1xz55ha/terraform-0.6.0/src/github.com/hashicorp/terraform/helper/schema/provider.go:162 +0x1da
2015/07/10 22:24:56 terraform-provider-aws: github.com/hashicorp/terraform/rpc.(*ResourceProviderServer).Apply(0xc208640720, 0xc208611300, 0xc2085c4960, 0x0, 0x0)
2015/07/10 22:24:56 terraform-provider-aws:     /private/tmp/terraform20150702-45875-1xz55ha/terraform-0.6.0/src/github.com/hashicorp/terraform/rpc/resource_provider.go:323 +0x7f
2015/07/10 22:24:56 terraform-provider-aws: reflect.Value.call(0x857e20, 0xa37060, 0x13, 0xaa2bc0, 0x4, 0xc2088c3f28, 0x3, 0x3, 0x0, 0x0, ...)
2015/07/10 22:24:56 terraform-provider-aws:     /usr/local/Cellar/go/1.4.2/libexec/src/reflect/value.go:419 +0x10e5
2015/07/10 22:24:56 terraform-provider-aws: reflect.Value.Call(0x857e20, 0xa37060, 0x13, 0xc2088c3f28, 0x3, 0x3, 0x0, 0x0, 0x0)
2015/07/10 22:24:56 terraform-provider-aws:     /usr/local/Cellar/go/1.4.2/libexec/src/reflect/value.go:296 +0xbc
2015/07/10 22:24:56 terraform-provider-aws: net/rpc.(*service).call(0xc2082c0bc0, 0xc2082c0a40, 0xc20861ae98, 0xc20891c300, 0xc208641300, 0x6a6840, 0xc208611300, 0x16, 0x6a68a0, 0xc2085c4960, ...)
2015/07/10 22:24:56 terraform-provider-aws:     /usr/local/Cellar/go/1.4.2/libexec/src/net/rpc/server.go:382 +0x1f7
2015/07/10 22:24:56 terraform-provider-aws: created by net/rpc.(*Server).ServeCodec
2015/07/10 22:24:56 terraform-provider-aws:     /usr/local/Cellar/go/1.4.2/libexec/src/net/rpc/server.go:476 +0x44a
2015/07/10 22:24:56 terraform-provider-aws: 

It appears there's no peering connection being returned from AWS here for some reason:

resp, err := conn.AcceptVPCPeeringConnection(req)
pc := resp.VPCPeeringConnection
return *pc.Status.Code, err

@phinze
Copy link
Contributor

phinze commented Jul 14, 2015

Yep looks like we just need some more conservative nil checking here.

@catsby
Copy link
Contributor

catsby commented Oct 13, 2015

Hello –

I wasn't able to reproduce this directly, but I did open and merge #3490 to add better error handling and check for nil references.

Please let me know if you're still hitting this.
Thanks!

@catsby catsby closed this as completed Oct 13, 2015
@ghost
Copy link

ghost commented Apr 30, 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 30, 2020
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

4 participants