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

0.9.0-rc2 crash on plan with ipv6 #12605

Closed blalor closed 7 years ago

blalor commented 7 years ago

Began from an empty state. Worked before setting assign_generated_ipv6_cidr_block = true on the VPC resource.

Terraform Version

Terraform v0.9.0-beta2 (dbb920ff54edea3ef975751d9ec31d6049eb5003)

apply output

[(master) tf-vpc]> terraform apply
data.aws_availability_zones.available: Refreshing state...
aws_vpc_dhcp_options.default: Creating...
  domain_name:           "" => "ec2.internal"
  domain_name_servers.#: "" => "1"
  domain_name_servers.0: "" => "AmazonProvidedDNS"
  tags.%:                "" => "1"
  tags.Name:             "" => "default"
aws_vpc.default: Creating...
  assign_generated_ipv6_cidr_block: "" => "true"
  cidr_block:                       "" => "192.168.0.0/16"
  default_network_acl_id:           "" => "<computed>"
  default_route_table_id:           "" => "<computed>"
  default_security_group_id:        "" => "<computed>"
  dhcp_options_id:                  "" => "<computed>"
  enable_classiclink:               "" => "<computed>"
  enable_dns_hostnames:             "" => "true"
  enable_dns_support:               "" => "true"
  instance_tenancy:                 "" => "default"
  ipv6_association_id:              "" => "<computed>"
  ipv6_cidr_block:                  "" => "<computed>"
  main_route_table_id:              "" => "<computed>"
  tags.%:                           "" => "1"
  tags.Name:                        "" => "default"
aws_vpc_dhcp_options.default: Creation complete (ID: dopt-8b3f6eec)
aws_vpc.default: Creation complete (ID: vpc-5c256e3a)
aws_internet_gateway.default: Creating...
  tags.%:    "0" => "1"
  tags.Name: "" => "default"
  vpc_id:    "" => "vpc-5c256e3a"
aws_subnet.public.0: Creating...
  assign_ipv6_address_on_creation: "" => "false"
  availability_zone:               "" => "us-east-1a"
  cidr_block:                      "" => "192.168.0.0/24"
  ipv6_cidr_block_association_id:  "" => "<computed>"
  map_public_ip_on_launch:         "" => "true"
  tags.%:                          "" => "1"
  tags.Name:                       "" => "public-us-east-1a"
  vpc_id:                          "" => "vpc-5c256e3a"
aws_subnet.public.1: Creating...
  assign_ipv6_address_on_creation: "" => "false"
  availability_zone:               "" => "us-east-1b"
  cidr_block:                      "" => "192.168.1.0/24"
  ipv6_cidr_block_association_id:  "" => "<computed>"
  map_public_ip_on_launch:         "" => "true"
  tags.%:                          "" => "1"
  tags.Name:                       "" => "public-us-east-1b"
  vpc_id:                          "" => "vpc-5c256e3a"
aws_vpc_dhcp_options_association.default: Creating...
  dhcp_options_id: "" => "dopt-8b3f6eec"
  vpc_id:          "" => "vpc-5c256e3a"
aws_subnet.private.0: Creating...
  assign_ipv6_address_on_creation: "" => "false"
  availability_zone:               "" => "us-east-1a"
  cidr_block:                      "" => "192.168.2.0/24"
  ipv6_cidr_block_association_id:  "" => "<computed>"
  map_public_ip_on_launch:         "" => "false"
  tags.%:                          "" => "1"
  tags.Name:                       "" => "private-us-east-1a"
  vpc_id:                          "" => "vpc-5c256e3a"
aws_subnet.private.1: Creating...
  assign_ipv6_address_on_creation: "" => "false"
  availability_zone:               "" => "us-east-1b"
  cidr_block:                      "" => "192.168.3.0/24"
  ipv6_cidr_block_association_id:  "" => "<computed>"
  map_public_ip_on_launch:         "" => "false"
  tags.%:                          "" => "1"
  tags.Name:                       "" => "private-us-east-1b"
  vpc_id:                          "" => "vpc-5c256e3a"
aws_vpc_dhcp_options_association.default: Creation complete (ID: dopt-8b3f...5c256e3a)
aws_internet_gateway.default: Creation complete (ID: igw-ec838f8b)
aws_route_table.default: Creating...
  route.#:                                   "" => "1"
  route.119906740.cidr_block:                "" => "0.0.0.0/0"
  route.119906740.gateway_id:                "" => "igw-ec838f8b"
  route.119906740.instance_id:               "" => ""
  route.119906740.nat_gateway_id:            "" => ""
  route.119906740.network_interface_id:      "" => ""
  route.119906740.vpc_peering_connection_id: "" => ""
  tags.%:                                    "" => "1"
  tags.Name:                                 "" => "default"
  vpc_id:                                    "" => "vpc-5c256e3a"
aws_subnet.private.1: Creation complete (ID: subnet-8b9875c3)
aws_subnet.private.0: Creation complete (ID: subnet-222f120f)
aws_subnet.public.0: Creation complete (ID: subnet-3d2f1210)
aws_subnet.public.1: Creation complete (ID: subnet-8c9875c4)
aws_network_acl.default: Creating...
  egress.#:                     "" => "1"
  egress.296684381.action:      "" => "allow"
  egress.296684381.cidr_block:  "" => "0.0.0.0/0"
  egress.296684381.from_port:   "" => "0"
  egress.296684381.icmp_code:   "" => ""
  egress.296684381.icmp_type:   "" => ""
  egress.296684381.protocol:    "" => "-1"
  egress.296684381.rule_no:     "" => "100"
  egress.296684381.to_port:     "" => "0"
  ingress.#:                    "" => "1"
  ingress.296684381.action:     "" => "allow"
  ingress.296684381.cidr_block: "" => "0.0.0.0/0"
  ingress.296684381.from_port:  "" => "0"
  ingress.296684381.icmp_code:  "" => ""
  ingress.296684381.icmp_type:  "" => ""
  ingress.296684381.protocol:   "" => "-1"
  ingress.296684381.rule_no:    "" => "100"
  ingress.296684381.to_port:    "" => "0"
  subnet_ids.#:                 "" => "4"
  subnet_ids.149570930:         "" => "subnet-3d2f1210"
  subnet_ids.3523695701:        "" => "subnet-8c9875c4"
  subnet_ids.3927231042:        "" => "subnet-8b9875c3"
  subnet_ids.525753569:         "" => "subnet-222f120f"
  tags.%:                       "" => "1"
  tags.Name:                    "" => "default"
  vpc_id:                       "" => "vpc-5c256e3a"
aws_route_table.default: Creation complete (ID: rtb-76e07e0f)
aws_main_route_table_association.default: Creating...
  original_route_table_id: "" => "<computed>"
  route_table_id:          "" => "rtb-76e07e0f"
  vpc_id:                  "" => "vpc-5c256e3a"
aws_main_route_table_association.default: Creation complete (ID: rtbassoc-90cbfee8)
Error applying plan:

1 error(s) occurred:

* aws_network_acl.default: 1 error(s) occurred:

* aws_network_acl.default: unexpected EOF

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
panic: runtime error: invalid memory address or nil pointer dereference
2017/03/11 09:30:34 [DEBUG] plugin: terraform: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x22979fe]
2017/03/11 09:30:34 [DEBUG] plugin: terraform: 
2017/03/11 09:30:34 [DEBUG] plugin: terraform: goroutine 587 [running]:
2017/03/11 09:30:34 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/builtin/providers/aws.networkAclEntriesToMapList(0xc420752d70, 0x2, 0x2, 0x4130bc0, 0xc4207d44a0, 0x0)
2017/03/11 09:30:34 [DEBUG] plugin: terraform:  /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_network_acl.go:590 +0x27e
2017/03/11 09:30:34 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/builtin/providers/aws.resourceAwsNetworkAclRead(0xc4202be540, 0x404b4c0, 0xc4207a81c0, 0xc4207611f8, 0x0)
2017/03/11 09:30:34 [DEBUG] plugin: terraform:  /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_network_acl.go:219 +0x6ec
2017/03/11 09:30:34 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/builtin/providers/aws.resourceAwsNetworkAclUpdate(0xc4202be540, 0x404b4c0, 0xc4207a81c0, 0x1, 0x1)
2017/03/11 09:30:34 [DEBUG] plugin: terraform:  /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_network_acl.go:327 +0x1e0
2017/03/11 09:30:34 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/builtin/providers/aws.resourceAwsNetworkAclCreate(0xc4202be540, 0x404b4c0, 0xc4207a81c0, 0x0, 0x0)
2017/03/11 09:30:34 [DEBUG] plugin: terraform:  /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_network_acl.go:164 +0x301
2017/03/11 09:30:34 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc420b88060, 0xc420a05360, 0xc420b0f240, 0x404b4c0, 0xc4207a81c0, 0x1, 0x28, 0xc420cc76e0)
2017/03/11 09:30:34 [DEBUG] plugin: terraform:  /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/resource.go:186 +0x48d
2017/03/11 09:30:34 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc420aaacc0, 0xc420a05310, 0xc420a05360, 0xc420b0f240, 0x7dc9960, 0x0, 0xc4206e9040)
2017/03/11 09:30:34 [DEBUG] plugin: terraform:  /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/provider.go:212 +0x9b
2017/03/11 09:30:34 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Apply(0xc4208eb6a0, 0xc420b0f160, 0xc420948b70, 0x0, 0x0)
2017/03/11 09:30:34 [DEBUG] plugin: terraform:  /opt/gopath/src/github.com/hashicorp/terraform/plugin/resource_provider.go:488 +0x57
2017/03/11 09:30:34 [DEBUG] plugin: terraform: reflect.Value.call(0xc420334180, 0xc42000d630, 0x13, 0x4c53ac3, 0x4, 0xc420d42f20, 0x3, 0x3, 0x0, 0xc420cbae01, ...)
2017/03/11 09:30:34 [DEBUG] plugin: terraform:  /opt/go/src/reflect/value.go:434 +0x91f
2017/03/11 09:30:34 [DEBUG] plugin: terraform: reflect.Value.Call(0xc420334180, 0xc42000d630, 0x13, 0xc420cbaf20, 0x3, 0x3, 0xc420cbaf68, 0x11f81f3, 0xc42115ee00)
2017/03/11 09:30:34 [DEBUG] plugin: terraform:  /opt/go/src/reflect/value.go:302 +0xa4
2017/03/11 09:30:34 [DEBUG] plugin: terraform: net/rpc.(*service).call(0xc420782600, 0xc4207825c0, 0xc4201c7078, 0xc420460e00, 0xc4208dc020, 0x404d9c0, 0xc420b0f160, 0x16, 0x404da00, 0xc420948b70, ...)
2017/03/11 09:30:34 [DEBUG] plugin: terraform:  /opt/go/src/net/rpc/server.go:387 +0x144
2017/03/11 09:30:34 [DEBUG] plugin: terraform: created by net/rpc.(*Server).ServeCodec
2017/03/11 09:30:34 [DEBUG] plugin: terraform:  /opt/go/src/net/rpc/server.go:481 +0x404
2017/03/11 09:30:34 [DEBUG] root: eval: *terraform.EvalWriteState
2017/03/11 09:30:34 [DEBUG] root: eval: *terraform.EvalApplyProvisioners
2017/03/11 09:30:34 [DEBUG] root: eval: *terraform.EvalIf
2017/03/11 09:30:34 [DEBUG] root: eval: *terraform.EvalWriteState
2017/03/11 09:30:34 [DEBUG] root: eval: *terraform.EvalWriteDiff
2017/03/11 09:30:34 [DEBUG] root: eval: *terraform.EvalApplyPost
2017/03/11 09:30:34 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:

* aws_network_acl.default: unexpected EOF
2017/03/11 09:30:34 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:

* aws_network_acl.default: unexpected EOF
2017/03/11 09:30:34 [TRACE] [walkApply] Exiting eval tree: aws_network_acl.default
2017/03/11 09:30:34 [DEBUG] dag/walk: upstream errored, not walking "meta.count-boundary (count boundary fixup)"
2017/03/11 09:30:34 [DEBUG] plugin: /Users/blalor/devel/dsa-rva/bin/terraform: plugin process exited
2017/03/11 09:30:34 [TRACE] Preserving existing state lineage "581dc95b-06ba-4e0f-ad37-71ede420443b"
2017/03/11 09:30:34 [DEBUG] Uploading remote state to S3: {
  Body: buffer(0xc4205e5680),
  Bucket: "remote_state-<uuid>",
  ContentLength: 11942,
  ContentType: "application/json",
  Key: "tf-vpc",
  ServerSideEncryption: "AES256"
}
2017/03/11 09:30:34 [WARN] plugin: error closing client during Kill: connection is shut down
2017/03/11 09:30:34 [DEBUG] plugin: waiting for all plugin processes to complete...

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.

When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.

[1]: https://github.com/hashicorp/terraform/issues

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform Configuration Files

config.zip

Panic Output

crash.log.zip

blalor commented 7 years ago

I also got an error on destroy after this crash:

Error applying plan:

1 error(s) occurred:

* aws_vpc.default (destroy): 1 error(s) occurred:

* aws_vpc.default: DependencyViolation: The vpc 'vpc-5c256e3a' has dependencies and cannot be deleted.
    status code: 400, request id: 235396a9-312f-45ac-9718-49de1ea102dc

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
[(master) tf-vpc]> terraform state list
aws_vpc.default

Looking in the console, I see a network ACL, route table, and security group that were apparently lost in the crash.

stack72 commented 7 years ago

Hi @blalor

I have just been working on resolving this issue today - IPv6 support for aws_network_acl has been added, and more importantly, had tests put around it :)

Therefore, it will be part of the 0.9 release

Paul

stack72 commented 7 years ago

Closed via #12641

blalor commented 7 years ago

yay! thanks!

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.