{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/6097","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/6097/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/6097/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/6097/events","html_url":"https://github.com/hashicorp/terraform/issues/6097","id":147040460,"number":6097,"title":"terraform crash when reading a lot of values out of consul","user":{"login":"dansteen","id":64940,"avatar_url":"https://avatars.githubusercontent.com/u/64940?v=3","gravatar_id":"","url":"https://api.github.com/users/dansteen","html_url":"https://github.com/dansteen","followers_url":"https://api.github.com/users/dansteen/followers","following_url":"https://api.github.com/users/dansteen/following{/other_user}","gists_url":"https://api.github.com/users/dansteen/gists{/gist_id}","starred_url":"https://api.github.com/users/dansteen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dansteen/subscriptions","organizations_url":"https://api.github.com/users/dansteen/orgs","repos_url":"https://api.github.com/users/dansteen/repos","events_url":"https://api.github.com/users/dansteen/events{/privacy}","received_events_url":"https://api.github.com/users/dansteen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/crash","name":"crash","color":"e11d21"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/aws","name":"provider/aws","color":"bfdadc"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/consul","name":"provider/consul","color":"bfdadc"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/waiting-response","name":"waiting-response","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-04-08T21:10:13Z","updated_at":"2016-07-07T22:06:41Z","closed_at":null,"body":"I get a terraform crash when I read a lot of entries from consul and then use them in my config.  As an example:\r\n\r\n```\r\nresource \"consul_keys\" \"matching-spark-scaler\" {\r\n    # get the values from consul for the config\r\n    # first determin if we enable scaling or not\r\n    key {\r\n      name = \"scale_up_enabled\"\r\n      path = \"app/matching-spark-scaler/${consul_keys.matching-spark-scaler-version.var.hash}/scaleUpEnabled\"\r\n    }\r\n    key {\r\n      name = \"scale_down_enabled\"\r\n      path = \"app/matching-spark-scaler/${consul_keys.matching-spark-scaler-version.var.hash}/scaleDownEnabled\"\r\n    }\r\n}\r\n```\r\n\r\nand then using the above in a resource:\r\n```\r\nresource \"aws_cloudwatch_metric_alarm\" \"matching-spark_max_memory_available\" {\r\n    alarm_name = \"matching-spark ${var.env} Max Memory Available\"\r\n    alarm_description = \"matching-spark ${var.env} Max Memory Available\"\r\n    namespace = \"AWS/ElasticMapReduce\"\r\n    statistic = \"Maximum\"\r\n    metric_name = \"MemoryAvailableMB\"\r\n    comparison_operator = \"GreaterThanOrEqualToThreshold\"\r\n    threshold = \"${ ( ( ( ( consul_keys.matching-spark-scaler.var.recycle_stream_executor_memory * consul_keys.matching-spark-scaler.var.recycle_stream_num_executors ) + consul_keys.matching-spark-scaler.var.recycle_stream_driver_memory ) + ( ( consul_keys.matching-spark-scaler.var.cluster_update_executor_memory * consul_keys.matching-spark-scaler.var.cluster_update_num_executors ) + consul_keys.matching-spark-scaler.var.cluster_update_driver_memory ) + ( ( consul_keys.matching-spark-scaler.var.streaming_kmeans_executor_memory * consul_keys.matching-spark-scaler.var.streaming_kmeans_num_executors ) + consul_keys.matching-spark-scaler.var.streaming_kmeans_driver_memory ) ) * consul_keys.matching-spark-scaler.var.max_app_capacity ) }\"\r\n    evaluation_periods = \"1\"\r\n    period = \"60\"\r\n    alarm_actions = [\"${aws_sns_topic.matching-spark-alarm.arn}\"]\r\n   # NOTE: the below causes an crash\r\n    actions_enabled = \"${consul_keys.matching-spark-scaler2.var.scale_down_enabled}\"\r\n    # NOTE: If I change it to this things work\r\n    #actions_enabled = \"true\"\r\n    dimensions {\r\n      JobFlowId = \"${consul_keys.matching-spark-alarm.var.cluster_id}\"\r\n    }\r\n}\r\n```\r\n\r\nBut the above doesn't really tell the whole story, as I have a few other similar resources, and a lot of other consul reads throughout my config.   As long as I disable the ones that look like the above then things succeed.  So it seems like I am hitting some limit or other.\r\n\r\nI have attached the crash log.\r\n\r\nv0.6.14\r\n\r\n[crash.log.gz](https://github.com/hashicorp/terraform/files/210853/crash.log.gz)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/231221908","html_url":"https://github.com/hashicorp/terraform/issues/6097#issuecomment-231221908","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/6097","id":231221908,"user":{"login":"dansteen","id":64940,"avatar_url":"https://avatars.githubusercontent.com/u/64940?v=3","gravatar_id":"","url":"https://api.github.com/users/dansteen","html_url":"https://github.com/dansteen","followers_url":"https://api.github.com/users/dansteen/followers","following_url":"https://api.github.com/users/dansteen/following{/other_user}","gists_url":"https://api.github.com/users/dansteen/gists{/gist_id}","starred_url":"https://api.github.com/users/dansteen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dansteen/subscriptions","organizations_url":"https://api.github.com/users/dansteen/orgs","repos_url":"https://api.github.com/users/dansteen/repos","events_url":"https://api.github.com/users/dansteen/events{/privacy}","received_events_url":"https://api.github.com/users/dansteen/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T22:06:41Z","updated_at":"2016-07-07T22:06:41Z","body":"So, since this original issue I've updated to v0.6.16, and I am no longer able to trigger this panic.  I do get this the first time I run \"apply\":\r\n\r\n```\r\nError applying plan:\r\n\r\n1 error(s) occurred:\r\n\r\n* consul_keys.matching-spark: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.\r\n\r\nPlease include the following information in your report:\r\n\r\n    Terraform Version: 0.6.16\r\n    Resource ID: consul_keys.matching-spark\r\n    Mismatch reason: attribute mismatch: key.1211574727.delete\r\n    Diff One (usually from plan): *terraform.InstanceDiff{Attributes:map[string]*terraform.ResourceAttrDiff{\"key.1211574727.path\":*terrafo\r\nrm.ResourceAttrDiff{Old:\"service/sns/matching-spark/stag\", New:\"service/sns/matching-spark/stag\", NewComputed:false, NewRemoved:false, New\r\nExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.1211574727.value\":*terraform.ResourceAttrDiff{Old:\"arn:aws:sns:us-east-1:31531\r\n6724794:matching-spark-alarm-stag\", New:\"arn:aws:sns:us-east-1:315316724794:matching-spark-alarm-stag\", NewComputed:false, NewRemoved:fals\r\ne, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.754144773.name\":*terraform.ResourceAttrDiff{Old:\"matching-spark cloudwat\r\nch min\", New:\"matching-spark cloudwatch min\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0\r\n}, \"key.~2348288191.delete\":*terraform.ResourceAttrDiff{Old:\"\", New:\"false\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(ni\r\nl), RequiresNew:false, Type:0x0}, \"key.2120412503.name\":*terraform.ResourceAttrDiff{Old:\"matching-spark emr config\", New:\"matching-spark e\r\nmr config\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.2937742136.delete\":*terraf\r\norm.ResourceAttrDiff{Old:\"false\", New:\"false\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x\r\n0}, \"key.2937742136.path\":*terraform.ResourceAttrDiff{Old:\"cloud/matching-spark/task_node_memory/stag\", New:\"cloud/matching-spark/task_nod\r\ne_memory/stag\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.2120412503.path\":*terr\r\naform.ResourceAttrDiff{Old:\"cloud/matching-spark/emr_config/stag\", New:\"cloud/matching-spark/emr_config/stag\", NewComputed:false, NewRemov\r\ned:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.1301176783.path\":*terraform.ResourceAttrDiff{Old:\"cloud/matching-\r\nspark/max_alarm_name/stag\", New:\"\", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.~23\r\n48288191.path\":*terraform.ResourceAttrDiff{Old:\"\", New:\"cloud/matching-spark/max_alarm_name/stag\", NewComputed:false, NewRemoved:false, Ne\r\nwExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.1211574727.name\":*terraform.ResourceAttrDiff{Old:\"matching-spark sns\", New:\"m\r\natching-spark sns\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.2937742136.value\":\r\n*terraform.ResourceAttrDiff{Old:\"15360\", New:\"15360\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false,\r\nType:0x0}, \"key.~2348288191.value\":*terraform.ResourceAttrDiff{Old:\"\", New:\"${aws_cloudwatch_metric_alarm.matching-spark_max_memory_availa\r\nble.id}\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.~2348288191.default\":*terraf\r\norm.ResourceAttrDiff{Old:\"\", New:\"\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.1\r\n301176783.delete\":*terraform.ResourceAttrDiff{Old:\"false\", New:\"false\", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), Re\r\nquiresNew:false, Type:0x0}, \"key.1211574727.default\":*terraform.ResourceAttrDiff{Old:\"\", New:\"\", NewComputed:false, NewRemoved:true, NewEx\r\ntra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.2937742136.name\":*terraform.ResourceAttrDiff{Old:\"task node memory\", New:\"task n\r\node memory\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.2120412503.value\":*terraf\r\norm.ResourceAttrDiff{Old:\"stag/config/emr/emr-config.json\", New:\"stag/config/emr/emr-config.json\", NewComputed:false, NewRemoved:false, Ne\r\nwExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.~2348288191.name\":*terraform.ResourceAttrDiff{Old:\"\", New:\"matching-spark clo\r\nudwatch max\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.754144773.path\":*terrafo\r\nrm.ResourceAttrDiff{Old:\"cloud/matching-spark/min_alarm_name/stag\", New:\"cloud/matching-spark/min_alarm_name/stag\", NewComputed:false, New\r\nRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.1211574727.delete\":*terraform.ResourceAttrDiff{Old:\"false\",\r\nNew:\"false\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.754144773.value\":*terrafo\r\nrm.ResourceAttrDiff{Old:\"matching-spark stag min Memory Available\", New:\"matching-spark stag min Memory Available\", NewComputed:false, New\r\nRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.2120412503.delete\":*terraform.ResourceAttrDiff{Old:\"false\",\r\nNew:\"false\", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.2120412503.default\":*terr\r\naform.ResourceAttrDiff{Old:\"\", New:\"\", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.\r\n1301176783.name\":*terraform.ResourceAttrDiff{Old:\"matching-spark cloudwatch max\", New:\"\", NewComputed:false, NewRemoved:true, NewExtra:int\r\nerface {}(nil), RequiresNew:false, Type:0x0}, \"key.754144773.delete\":*terraform.ResourceAttrDiff{Old:\"false\", New:\"false\", NewComputed:fal\r\nse, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.754144773.default\":*terraform.ResourceAttrDiff{Old:\"\"\r\n, New:\"\", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.2937742136.default\":*terrafor\r\nm.ResourceAttrDiff{Old:\"\", New:\"\", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, \"key.1301\r\n176783.default\":*terraform.ResourceAttrDiff{Old:\"\", New:\"\", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:fa\r\nlse, Type:0x0}}, Destroy:false, DestroyTainted:false}\r\n    Diff Two (usually from apply): *terraform.InstanceDiff{Attributes:map[string]*terraform.ResourceAttrDiff(nil), Destroy:false, DestroyT\r\nainted:false}\r\n\r\n\r\n```\r\n\r\nBut that's not unusual for this sort of thing, and it goes away with a second \"apply\", so I think this can be safely closed.\r\n\r\nThanks for following up!"}}
{"actor":{"display_login":"dansteen"}}