Closed pmoust closed 10 years ago
It is reproducable locally each time, first pass crashes, second succeeds. Could be coincidental of course. here is the tfstate before destroy
~/pph/pph-iac/peopleperhour/mailchap ⮀ ⭠ mailchap-terraform ● ⮀ terraform show
aws_instance.mailchap: (tainted)
id = <not created>
aws_security_group.mailchap:
id = sg-89f6f3ec
description = Mailchap security group
ingress.# = 1
ingress.0.cidr_blocks.# = 1
ingress.0.cidr_blocks.0 = 0.0.0.0/0
ingress.0.from_port = 80
ingress.0.protocol = tcp
ingress.0.to_port = 80
name = mailchap
vpc_id = vpc-bcae28d9
aws_security_group.mailchap_admins:
id = sg-88f6f3ed
description = Allows access to administrators and trusted sources
ingress.# = 2
ingress.0.cidr_blocks.# = 3
ingress.0.cidr_blocks.0 = sensitive/32
ingress.0.cidr_blocks.1 = sensitive/32
ingress.0.cidr_blocks.2 = sensitive/32
ingress.0.from_port = 0
ingress.0.protocol = tcp
ingress.0.to_port = 65535
ingress.1.cidr_blocks.# = 2
ingress.1.cidr_blocks.0 = sensitive/32
ingress.1.cidr_blocks.1 = sensitive/32
ingress.1.from_port = 0
ingress.1.protocol = tcp
ingress.1.to_port = 65535
name = mailchap_admins
vpc_id = vpc-bcae28d9
aws_subnet.mailchap:
id = subnet-71bb7d28
availability_zone = us-east-1c
cidr_block = 10.11.0.0/16
map_public_ip_on_launch = true
vpc_id = vpc-bcae28d9
aws_vpc.mailchap:
id = vpc-bcae28d9
cidr_block = 10.11.0.0/16
enable_dns_hostnames = true
enable_dns_support = true
main_route_table_id = rtb-409e1e25
tags.Name = Mailchap
Same issue and steps to reproduce.
@pmoust Can you share a configuration that makes this fail? I'll keep trying to find it in the mean time.
@mitchellh What you could try in the mean time is to apply
with an aws instance-to-be-tainted (I use local-exec
with command = "false"
to taint). Then destroy
right after.
My guess is that this happens if the instance is still being on_creation status on the AWS when destroy
takes place.
If that is not reproducing it, try adding a resource that is depending on it (i.e. make the instance to have a public facing IP and have its subnet have an internet gateway for 0.0.0.0/0) that also might be an issue with my configuration seeing your commits fixing Dependency Violation issues (waiting 5*mins retrying).
Sorry for not providing a simple configuration for you to check -I am at the beach atm-, I can share configuration by Monday.
Actually thinking of second paragraph: it's a separate issue opened PR https://github.com/hashicorp/terraform/pull/448
Here are my configs to reproduce and the crash.log file
https://github.com/blkperl/ops-terraform/tree/terraform_issue_412
Still learning terraform, when I do apply the remote-exec fails because it can't connect to the instance, and then when I try to destroy terraform crashes.
Got it to reproduce. The easiest config to do this:
resource "null_resource" "foo" {
provisioner "local-exec" {
command = "false"
}
}
terraform apply
terraform destroy
Fixed! THis uncovered another issue, which I'm working on now, but the one in this subject is fixed.
Simple configuration with
aws_vpc
,aws_vpc_subnet
,aws_route53_record
,aws_instance
,aws_security_group
records linked together. After local provisioner failed, andaws_instance
got tainted, I ranterraform destroy
that on first pass resulted on crash.Second pass was successful.
Terraform version: just built from upstream.
Here is the crash.log