{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/9964","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/9964/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/9964/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/9964/events","html_url":"https://github.com/hashicorp/terraform/issues/9964","id":188071999,"number":9964,"title":"stack overflow error when calling *.tfplan file for destroy","user":{"login":"brycekottke","id":9055527,"avatar_url":"https://avatars.githubusercontent.com/u/9055527?v=3","gravatar_id":"","url":"https://api.github.com/users/brycekottke","html_url":"https://github.com/brycekottke","followers_url":"https://api.github.com/users/brycekottke/followers","following_url":"https://api.github.com/users/brycekottke/following{/other_user}","gists_url":"https://api.github.com/users/brycekottke/gists{/gist_id}","starred_url":"https://api.github.com/users/brycekottke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brycekottke/subscriptions","organizations_url":"https://api.github.com/users/brycekottke/orgs","repos_url":"https://api.github.com/users/brycekottke/repos","events_url":"https://api.github.com/users/brycekottke/events{/privacy}","received_events_url":"https://api.github.com/users/brycekottke/received_events","type":"User","site_admin":false},"labels":[{"id":85946957,"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7","default":true},{"id":127939292,"url":"https://api.github.com/repos/hashicorp/terraform/labels/core","name":"core","color":"cccccc","default":false},{"id":120957393,"url":"https://api.github.com/repos/hashicorp/terraform/labels/waiting-response","name":"waiting-response","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-08T18:46:43Z","updated_at":"2016-11-09T22:58:57Z","closed_at":null,"body":"I came across a very strange issue yesterday with terraform. It was throwing a stack overflow error when trying to destroy an environment in the following way:\r\n\r\n// Versions  \r\nversion used to create: v0.7.4  \r\nversion used to destroy: v0.7.4, v0.7.7\r\n\r\n// Affected Resource  \r\naws_launch_configuration\r\n\r\n// Command Failing  \r\nterraform apply destroy.tfplan\r\n\r\n// Expected Behavior  \r\nShould have destroyed the environment\r\n\r\n// DEBUG Steps Taken  \r\nSee Below\r\n\r\n---\r\n\r\n// Destroy Environment\r\n```\r\n# plan destroy (gives output of destroy and creates destroy.tfplan)\r\nterraform plan -destroy -var-file=my.tfvars -out=destroy.tfplan\r\n\r\n# submit destroy\r\nterraform apply destroy.plan\r\n\r\n#output (does NOT destroy environment)\r\n<blank>\r\n$ echo $?\r\n2\r\n```\r\n\r\n// Destroy Environment - DUBUG LOG\r\n```\r\n# I enabled TF_LOG / TF_LOG_FILE variables to log the destroy process.\r\n\r\n$ terraform apply destroy.tfplan\r\n\r\n```2016/11/07 12:57:33 [DEBUG] hasDestroyEdgeInPath: Looking for destroy edge: module.test.aws_launch_configuration.lc - *terraform.GraphNodeConfigResourceFlat\r\nruntime: goroutine stack exceeds 1000000000-byte limit\r\nfatal error: stack overflow\r\n\r\nruntime stack:\r\nruntime.throw(0x2ea051e, 0xe)\r\n    /opt/go/src/runtime/panic.go:566 +0x95\r\n```\r\n\r\nIt appears there is some sort of bug when destroying from a previous terraform plan which used the \"-out=\" flag. When this is called later for destroy, it throws the above error in the stack DEBUG logs. I haven't seen this before, and could not find anything on the terraform github page / issues in regards to this. Just want to make everyone aware. I tested with terraform versions 0.7.4 and 0.7.7.\r\n\r\n// Work-Around\r\n```\r\n# Destroy environment without specifying the destroy.tfplan file.\r\n\r\n$ terraform destroy -var-file=my.tfvars\r\n```"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/259551382","html_url":"https://github.com/hashicorp/terraform/issues/9964#issuecomment-259551382","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/9964","id":259551382,"user":{"login":"brycekottke","id":9055527,"avatar_url":"https://avatars.githubusercontent.com/u/9055527?v=3","gravatar_id":"","url":"https://api.github.com/users/brycekottke","html_url":"https://github.com/brycekottke","followers_url":"https://api.github.com/users/brycekottke/followers","following_url":"https://api.github.com/users/brycekottke/following{/other_user}","gists_url":"https://api.github.com/users/brycekottke/gists{/gist_id}","starred_url":"https://api.github.com/users/brycekottke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brycekottke/subscriptions","organizations_url":"https://api.github.com/users/brycekottke/orgs","repos_url":"https://api.github.com/users/brycekottke/repos","events_url":"https://api.github.com/users/brycekottke/events{/privacy}","received_events_url":"https://api.github.com/users/brycekottke/received_events","type":"User","site_admin":false},"created_at":"2016-11-09T22:58:57Z","updated_at":"2016-11-09T22:58:57Z","body":"Hey Mitch,  \r\n\r\nThank you for the response. I've attempted to reproduce the issue. Here are the results of the state files for both the 'apply' and 'destroy' phase:  \r\n\r\n**terraform.tfstate.apply.bug.log**\r\n```\r\n$ terraform plan -var-file my.tfvars -out create.tfplan\r\n$ terraform apply create.tfplan\r\n```\r\n\r\n**terraform.tfstate.destroy.bug.log**\r\n```\r\n$ terraform plan -destroy -var-file my.tfvars -out destroy.tfplan\r\n$ terraform apply destroy.tfplan\r\n<reports nothing>\r\n$ echo $?\r\n2\r\n```  \r\n\r\nIf there is anything else you need just let me know and I will do my best to provide it.  \r\n\r\nThanks,  \r\n- Bryce  \r\n[tfstate_logs.zip](https://github.com/hashicorp/terraform/files/582090/tfstate_logs.zip)\r\n"}}
{"actor":{"display_login":"brycekottke"}}