{"action":"closed","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/6253","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/6253/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/6253/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/6253/events","html_url":"https://github.com/hashicorp/terraform/issues/6253","id":149610484,"number":6253,"title":"Terraform crash when S3 bucket website created with an empty string assigned to index_document ","user":{"login":"jwieringa","id":307685,"avatar_url":"https://avatars.githubusercontent.com/u/307685?v=3","gravatar_id":"","url":"https://api.github.com/users/jwieringa","html_url":"https://github.com/jwieringa","followers_url":"https://api.github.com/users/jwieringa/followers","following_url":"https://api.github.com/users/jwieringa/following{/other_user}","gists_url":"https://api.github.com/users/jwieringa/gists{/gist_id}","starred_url":"https://api.github.com/users/jwieringa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwieringa/subscriptions","organizations_url":"https://api.github.com/users/jwieringa/orgs","repos_url":"https://api.github.com/users/jwieringa/repos","events_url":"https://api.github.com/users/jwieringa/events{/privacy}","received_events_url":"https://api.github.com/users/jwieringa/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"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-19T23:23:00Z","updated_at":"2016-04-21T13:07:01Z","closed_at":"2016-04-21T13:07:01Z","body":"### Terraform Version\r\n\r\n```\r\n$ terraform -v\r\nTerraform v0.6.14\r\n```\r\n\r\n### Affected Resource(s)\r\n\r\n- aws_s3_bucket\r\n\r\n### Terraform Configuration Files\r\n\r\n```hcl\r\nprovider \"aws\" {\r\n  region     = \"us-east-1\"\r\n  access_key = \"${var.aws_access_key}\"\r\n  secret_key = \"${var.aws_secret_key}\"\r\n}\r\n\r\nresource \"aws_s3_bucket\" \"v1\" {\r\n  bucket = \"test-tf-website\"\r\n\r\n  website {\r\n    index_document = \"\"\r\n    error_document = \"\"\r\n  }\r\n}\r\n```\r\n\r\n### Working Terraform Configuration Files\r\n\r\n```hcl\r\nprovider \"aws\" {\r\n  region     = \"us-east-1\"\r\n  access_key = \"${var.aws_access_key}\"\r\n  secret_key = \"${var.aws_secret_key}\"\r\n}\r\n\r\nresource \"aws_s3_bucket\" \"v1\" {\r\n  bucket = \"test-tf-website\"\r\n\r\n  website {\r\n    # do not pass an empty string to index_document\r\n    index_document = \"index.html\"\r\n    error_document = \"\"\r\n  }\r\n}\r\n```\r\n\r\n### Panic Output\r\n\r\nTerraform `crash.log` https://gist.github.com/jwieringa/f1e8f851274cd56571460aa73ba52ec7\r\n\r\n### Expected Behavior\r\n\r\nI expected a S3 bucket to be created with a website configuration containing empty values for `index_document` and `error_document`.\r\n\r\n```\r\n$ terraform plan\r\nRefreshing Terraform state prior to plan...\r\n\r\n+ aws_s3_bucket.v1\r\n    acl:              \"\" => \"private\"\r\n    arn:              \"\" => \"<computed>\"\r\n    bucket:           \"\" => \"test-tf-website\"\r\n    force_destroy:    \"\" => \"0\"\r\n    hosted_zone_id:   \"\" => \"<computed>\"\r\n    region:           \"\" => \"<computed>\"\r\n    website.#:        \"\" => \"1\"\r\n    website_domain:   \"\" => \"<computed>\"\r\n    website_endpoint: \"\" => \"<computed>\"\r\n\r\n\r\nPlan: 1 to add, 0 to change, 0 to destroy.\r\n```\r\n\r\n### Actual Behavior\r\n\r\nIn the above configurations, terraform crashed and no bucket was created.\r\n\r\nI observed a different behavior against my production configurations which I have not been able to reproduce in an example; however, I think it is worth noting because the `terraform.tfstate` file changed caused subsequent `apply`'s to fail.\r\n\r\n+ The bucket for the website, `static_assets`, was not created\r\n+ Bucket, `logs`, not related to the config was removed from `terraform.tfstate`\r\n+ Bucket `logs` was not deleted from AWS\r\n+ Bucket `logs` was not listed in the plan\r\n+ Terraform did not crash, instead it emitted two errors\r\n\r\n```\r\n2 error(s) occurred:\r\n\r\n* aws_s3_bucket.logs: unexpected EOF\r\n* aws_s3_bucket.static_assets: unexpected EOF\r\n```\r\n\r\nTo resolve, I recovered a previous version of `terraform.tfstate` from backups.\r\n\r\n### Steps to Reproduce\r\n\r\nUsing the above configurations:\r\n\r\n1. `terraform apply`\r\n\r\n### References\r\n\r\nThis issue was similar to the error received on my production configurations.\r\n\r\n- https://github.com/hashicorp/terraform/issues/4706"}}