{"action":"opened","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/4262","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/4262/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/4262/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/4262/events","html_url":"https://github.com/hashicorp/terraform/issues/4262","id":121729180,"number":4262,"title":"Subsequent run of chef provisioner on a converged instance fails","user":{"login":"lhagemann","id":366088,"avatar_url":"https://avatars.githubusercontent.com/u/366088?v=3","gravatar_id":"","url":"https://api.github.com/users/lhagemann","html_url":"https://github.com/lhagemann","followers_url":"https://api.github.com/users/lhagemann/followers","following_url":"https://api.github.com/users/lhagemann/following{/other_user}","gists_url":"https://api.github.com/users/lhagemann/gists{/gist_id}","starred_url":"https://api.github.com/users/lhagemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lhagemann/subscriptions","organizations_url":"https://api.github.com/users/lhagemann/orgs","repos_url":"https://api.github.com/users/lhagemann/repos","events_url":"https://api.github.com/users/lhagemann/events{/privacy}","received_events_url":"https://api.github.com/users/lhagemann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-11T15:27:38Z","updated_at":"2015-12-11T15:27:38Z","closed_at":null,"body":"Terraform v0.6.8\r\n\r\nAttempting to update the chef run_list on a node which has already had the first run of a chef client fails with `* Uploading validation.pem failed: scp: /etc/chef/validation.pem: Permission denied`\r\n\r\nI have an aws_instance which was provisioned by terraform_chef_provisioner, if I want to update the run_list, and have that applied to the chef client, I receive the failure above. \r\n\r\nTerraform module is defined with an `aws_instance` resource & a `null_resource` for the chef provisioner which is triggered off `aws_instance.NAME.id`.\r\n\r\nFirst attempt I tried tainting the `aws_resource` and running `apply` again, this triggered issue #649, as the instance was destroyed, and the subesquent run failed due to the node & client already existing on the chef server.\r\n\r\nSecond attempt: I tainted the `null_resource` followed by `plan` and `apply` which fails with the error above. \r\n[example.lhagemann.tf.tar.zip](https://github.com/hashicorp/terraform/files/59541/example.lhagemann.tf.tar.zip)\r\n\r\n\r\n\r\nFull Output\r\n\r\n```\r\n$ tf apply\r\nnull_resource.NAME: Refreshing state... (ID: 5285253368098350675)\r\nmodule.NAME.template_file.SUBDOMAIN: Refreshing state... (ID: b1f262b04baf550a9951c9b8ff9858d315ab1637b100b729b4c538963f27d904)\r\nmodule.our_aws_subnet.aws_subnet.test: Refreshing state... (ID: subnet-f2b3a1d9)\r\naws_instance.NAME: Refreshing state... (ID: i-029d6bb3)\r\nmodule.gpg_keys.null_resource.key_upload: Refreshing state... (ID: 6481417946640352673)\r\nnull_resource.NAME: Destroying...\r\nnull_resource.NAME: Creating...\r\n  triggers.#:                    \"\" => \"1\"\r\n  triggers.cluster_instance_ids: \"\" => \"i-029d6bb3\"\r\nnull_resource.NAME: Provisioning with 'chef'...\r\nnull_resource.NAME (chef): Connecting to remote host via SSH...\r\nnull_resource.NAME (chef):   Host: 100.88.9.127\r\nnull_resource.NAME (chef):   User: ubuntu\r\nnull_resource.NAME (chef):   Password: false\r\nnull_resource.NAME (chef):   Private key: true\r\nnull_resource.NAME (chef):   SSH Agent: true\r\nnull_resource.NAME (chef): Connected!\r\nnull_resource.NAME (chef):   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\nnull_resource.NAME (chef):                                  Dload  Upload   Total   Spent    Left  Speed\r\nnull_resource.NAME (chef):   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\r\nnull_resource.NAME (chef):   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\r\nnull_resource.NAME (chef): 100 18716  100 18716    0     0  35614      0 --:--:-- --:--:-- --:--:-- 35581\r\nnull_resource.NAME (chef): Downloading Chef 11.12.8 for ubuntu...\r\nnull_resource.NAME (chef): downloading https://www.chef.io/chef/metadata?v=11.12.8&prerelease=false&nightlies=false&p=ubuntu&pv=14.04&m=x86_64\r\nnull_resource.NAME (chef):   to file /tmp/install.sh.1599/metadata.txt\r\nnull_resource.NAME (chef): trying wget...\r\nnull_resource.NAME (chef): url\thttps://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/13.04/x86_64/chef_11.12.8-2_amd64.deb\r\nnull_resource.NAME (chef): md5\t708874f3a14484376ec3ab19ae9703f6\r\nnull_resource.NAME (chef): sha256\t0e6a2f89d4231782d72a5cd5fbf9609a1e5a3ee38c7fccbebe6707dd86ac271e\r\nnull_resource.NAME (chef): downloaded metadata file looks valid...\r\nnull_resource.NAME (chef): downloading https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/13.04/x86_64/chef_11.12.8-2_amd64.deb\r\nnull_resource.NAME (chef):   to file /tmp/install.sh.1599/chef_11.12.8-2_amd64.deb\r\nnull_resource.NAME (chef): trying wget...\r\nnull_resource.NAME (chef): Comparing checksum with sha256sum...\r\nnull_resource.NAME (chef): Installing Chef 11.12.8\r\nnull_resource.NAME (chef): installing with dpkg...\r\nnull_resource.NAME (chef): (Reading database ...\r\nnull_resource.NAME (chef): (Reading database ... 5%\r\nnull_resource.NAME (chef): (Reading database ... 10%\r\nnull_resource.NAME (chef): (Reading database ... 15%\r\nnull_resource.NAME (chef): (Reading database ... 20%\r\nnull_resource.NAME (chef): (Reading database ... 25%\r\nnull_resource.NAME (chef): (Reading database ... 30%\r\nnull_resource.NAME (chef): (Reading database ... 35%\r\nnull_resource.NAME (chef): (Reading database ... 40%\r\nnull_resource.NAME (chef): (Reading database ... 45%\r\nnull_resource.NAME (chef): (Reading database ... 50%\r\nnull_resource.NAME (chef): (Reading database ... 55%\r\nnull_resource.NAME (chef): (Reading database ... 60%\r\nnull_resource.NAME (chef): (Reading database ... 65%\r\nnull_resource.NAME (chef): (Reading database ... 70%\r\nnull_resource.NAME (chef): (Reading database ... 75%\r\nnull_resource.NAME (chef): (Reading database ... 80%\r\nnull_resource.NAME (chef): (Reading database ... 85%\r\nnull_resource.NAME (chef): (Reading database ... 90%\r\nnull_resource.NAME (chef): (Reading database ... 95%\r\nnull_resource.NAME (chef): (Reading database ... 100%\r\nnull_resource.NAME (chef): (Reading database ... 101558 files and directories currently installed.)\r\nnull_resource.NAME (chef): Preparing to unpack .../chef_11.12.8-2_amd64.deb ...\r\nnull_resource.NAME (chef): Unpacking chef (11.12.8-2) over (11.12.8-2) ...\r\nnull_resource.NAME (chef): Setting up chef (11.12.8-2) ...\r\nnull_resource.NAME (chef): Thank you for installing Chef!\r\nnull_resource.NAME (chef): Creating configuration files...\r\nError applying plan:\r\n\r\n1 error(s) occurred:\r\n\r\n* Uploading validation.pem failed: scp: /etc/chef/validation.pem: Permission denied\r\n```\r\n"}}