{"action":"opened","issue":{"url":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/371","labels_url":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/371/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/371/comments","events_url":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/371/events","html_url":"https://github.com/chef/chef-provisioning-aws/issues/371","id":111868014,"number":371,"title":"InvalidInstanceIDNotFound on creating machine_image","user":{"login":"christinedraper","id":6227274,"avatar_url":"https://avatars.githubusercontent.com/u/6227274?v=3","gravatar_id":"","url":"https://api.github.com/users/christinedraper","html_url":"https://github.com/christinedraper","followers_url":"https://api.github.com/users/christinedraper/followers","following_url":"https://api.github.com/users/christinedraper/following{/other_user}","gists_url":"https://api.github.com/users/christinedraper/gists{/gist_id}","starred_url":"https://api.github.com/users/christinedraper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christinedraper/subscriptions","organizations_url":"https://api.github.com/users/christinedraper/orgs","repos_url":"https://api.github.com/users/christinedraper/repos","events_url":"https://api.github.com/users/christinedraper/events{/privacy}","received_events_url":"https://api.github.com/users/christinedraper/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-16T16:44:42Z","updated_at":"2015-10-16T16:44:42Z","closed_at":null,"body":"With chef-provisioning-aws 1.4.1 it looks like machine_image isn't waiting until the instance is properly available before trying to create the image. It completes OK on the second chef-client run.\r\n\r\n```\r\n   - Create testappserver-aws1_image with AMI ami-1a1eff29 in us-west-2[2015-10-16T09:36:04-07:00] INFO: Processing chef_node[testappserver-aws1_image] action create (basic_chef_client::block line 57)\r\n[2015-10-16T09:36:04-07:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/testappserver-aws1_image\r\n\r\n    - create node testappserver-aws1_image at chefzero://localhost:8889\r\n    -   update chef_environment from \"_default\" to \"test\"\r\n    -   add normal.tags = [\"test\"]\r\n    -   add normal.topo = {\"node_type\"=>\"appserver\", \"name\"=>\"inttest1\"}\r\n    -   add normal.test_top_level_bool = true\r\n    -   add normal.test_top_level_num = 2\r\n    -   add normal.testapp = {\"user\"=>\"ubuntu\", \"path\"=>\"/var/opt\", \"test_bool\"=>false, \"test_num\"=>5.4, \"db_location\"=>\"172.31.32.63\", \"test_ref\"=>false}\r\n    -   add normal.chef_provisioning = {\"reference\"=>{\"driver_version\"=>\"1.4.1\", \"allocated_at\"=>\"2015-10-16 16:36:04 UTC\", \"host_node\"=>\"chefzero://localhost:8889/nodes/\", \"image_id\"=>\"ami-1a1eff29\", \"instance_id\"=>\"i-52c60496\", \"key_name\"=>\"xxxxx\", \"ssh_username\"=>\"ubuntu\"}, \"driver_url\"=>\"aws:xxxxx\"}\r\n    -   update run_list from [] to [\"recipe[apt]\", \"recipe[testapp::appserver]\", \"recipe[testapp::deploy]\"][2015-10-16T09:36:04-07:00] INFO: [Aws::EC2::Client 200 0.113569 0 retries] describe_instances(instance_ids:[\"i-52c60496\"])  \r\n\r\n[2015-10-16T09:36:04-07:00] INFO: [Aws::EC2::Client 200 0.128373 0 retries] describe_instances(instance_ids:[\"i-52c60496\"])  \r\n\r\n[2015-10-16T09:36:04-07:00] INFO: [Aws::EC2::Client 400 0.085271 0 retries] describe_instances(instance_ids:[\"i-52c60496\"]) Aws::EC2::Errors::InvalidInstanceIDNotFound The instance ID 'i-52c60496' does not exist\r\n\r\n\r\n    ================================================================================\r\n    Error executing action `create` on resource 'machine_image[testappserver-aws1_image]'\r\n    ================================================================================\r\n    \r\n    Aws::EC2::Errors::InvalidInstanceIDNotFound\r\n```"}}