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

Terraform Crash version v0.6.10 #4915

Closed
achalupa74 opened this issue Jan 30, 2016 · 7 comments
Closed

Terraform Crash version v0.6.10 #4915

achalupa74 opened this issue Jan 30, 2016 · 7 comments

Comments

@achalupa74
Copy link

crash.zip
I managed to get a terraform crash during a 'terraform apply' run:

!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 Terraform1 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.

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
[jenkins-slave@bosbld-man dev]$ ls
crash.log dev.tf terraform.tfstate terraform.tfstate.backup
[jenkins-slave@bosbld-man dev]$ terraform -version
Terraform v0.6.9

Your version of Terraform is out of date! The latest version
is 0.6.10. You can update by downloading from www.terraform.io
[jenkins-slave@bosbld-man dev]$

Attached is the crash log.

@jen20
Copy link
Contributor

jen20 commented Feb 1, 2016

Thanks for opening the issue @achalupa74 - we'll get this resolved.

Relevant section of the crash log:

2016/01/30 11:46:32 [DEBUG] terraform-provider-aws: panic: runtime error: invalid memory address or nil pointer dereference
2016/01/30 11:46:32 [DEBUG] terraform-provider-aws: [signal 0xb code=0x1 addr=0x0 pc=0x5829b3]
2016/01/30 11:46:32 [DEBUG] terraform-provider-aws: 
2016/01/30 11:46:32 [DEBUG] terraform-provider-aws: goroutine 1597 [running]:
2016/01/30 11:46:32 [DEBUG] terraform-provider-aws: github.com/hashicorp/terraform/builtin/providers/aws.routeIDHash(0xc8237674a0, 0x0, 0x0, 0x0)
2016/01/30 11:46:32 [DEBUG] terraform-provider-aws:     /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route.go:303 +0xa3
2016/01/30 11:46:32 [DEBUG] terraform-provider-aws: github.com/hashicorp/terraform/builtin/providers/aws.resourceAwsRouteCreate(0xc8237674a0, 0xcedda0, 0xc821f22b40, 0x0, 0x0)
2016/01/30 11:46:32 [DEBUG] terraform-provider-aws:     /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_route.go:161 +0x9bd

@catsby
Copy link
Contributor

catsby commented Feb 1, 2016

Thanks for opening this @achalupa74 – you don't by chance have a sample configuration file (minus any secrets) that demonstrates this, do you?

@achalupa74
Copy link
Author

Thanks for the responses guys. I'm willing to share my scripts. I've stripped out any passwords or AWS keys. Warning there are several modules in this package. I've only seen the crash twice so for (most recently this afternoon). Attached is my set of scripts.

To run the scripts CD to the folder: \terraform\deployments\Manhattan\dev,
then run 'terraform apply'.

terraform.zip

@achalupa74 achalupa74 changed the title Terraform Crash version v0.6.9 Terraform Crash version v0.6.10 Feb 1, 2016
@jen20
Copy link
Contributor

jen20 commented Mar 21, 2016

Doing some more investigation here: it looks like the crash was in the following code which has subsequently moved around a bit since v0.6.10:

func routeIDHash(d *schema.ResourceData, r *ec2.Route) string {
    return fmt.Sprintf("r-%s%d", d.Get("route_table_id").(string), hashcode.String(*r.DestinationCidrBlock))
}

I'd imagine that the crash must be in the dereference of r.DestinationCidrBlock though it is hard to imagine how the route could exist in this case, and I cannot reproduce this locally.

@catsby
Copy link
Contributor

catsby commented Mar 29, 2016

This should be fixed in #5155; before that patch, if no route was found, nil was returned for the route and thus nil pointer dereferences 😦

@catsby catsby closed this as completed Mar 29, 2016
@catsby
Copy link
Contributor

catsby commented Mar 29, 2016

Sorry – meant to include that #5155 went out in the v0.6.12 release of Terraform, so upgrading to at least that should fix this issue. Thanks!

@ghost
Copy link

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

3 participants