{"action":"created","issue":{"url":"https://api.github.com/repos/test-kitchen/test-kitchen/issues/601","labels_url":"https://api.github.com/repos/test-kitchen/test-kitchen/issues/601/labels{/name}","comments_url":"https://api.github.com/repos/test-kitchen/test-kitchen/issues/601/comments","events_url":"https://api.github.com/repos/test-kitchen/test-kitchen/issues/601/events","html_url":"https://github.com/test-kitchen/test-kitchen/issues/601","id":56827778,"number":601,"title":"PR#589 Causes chef-client installations to report as failed when they have actually succeeded","user":{"login":"robcoward","id":5603418,"avatar_url":"https://avatars.githubusercontent.com/u/5603418?v=3","gravatar_id":"","url":"https://api.github.com/users/robcoward","html_url":"https://github.com/robcoward","followers_url":"https://api.github.com/users/robcoward/followers","following_url":"https://api.github.com/users/robcoward/following{/other_user}","gists_url":"https://api.github.com/users/robcoward/gists{/gist_id}","starred_url":"https://api.github.com/users/robcoward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robcoward/subscriptions","organizations_url":"https://api.github.com/users/robcoward/orgs","repos_url":"https://api.github.com/users/robcoward/repos","events_url":"https://api.github.com/users/robcoward/events{/privacy}","received_events_url":"https://api.github.com/users/robcoward/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/test-kitchen/test-kitchen/labels/in%20progress","name":"in progress","color":"ededed"},{"url":"https://api.github.com/repos/test-kitchen/test-kitchen/labels/Windows","name":"Windows","color":"00ACFC"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-02-06T15:44:54Z","updated_at":"2015-03-07T22:06:41Z","closed_at":null,"body":"#589 seems to be causing my converges to fail. I'm using bundler to pull in the latest github code for test-kitchen (windows-guest-support branch) & kitchen-ec2 (afiune/kitchen-ec2 Transport branch) and running 'bundle exec kitchen create' is launching an ec2 instance successfully, however when running the converge, it fails on trying to install chef-client. It makes no difference installing the latest omnibus or specifying an 11.x version.\r\n\r\nLogging into the Win2012 server shows that Chef Client is in fact installed correctly.\r\n\r\n```\r\n-----> Installing Chef Omnibus (latest)\r\n>>>>>> ------Exception-------\r\n>>>>>> Class: Kitchen::ActionFailed\r\n>>>>>> Message: Failed to complete #converge action: [Transport WinRM exited (1) using shell [powershell] for command: [\r\n# @return True if chef path exist, False otherwise\r\nfunction is_chef_installed { Test-Path /opscode/chef }\r\n\r\n# @param $version the requested version of omnibus package\r\n# @return True if omnibus needs to be installed, False otherwise\r\nfunction should_update_chef($version) {\r\n  if (-Not (is_chef_installed)) { return $true }\r\n\r\n  try {\r\n    $chef_version=(chef-solo -v).split(' ',2)[1]\r\n  } catch [Exception] {\r\n    $chef_version = ''\r\n  }\r\n\r\n  switch ($version) {\r\n    { 'true', $chef_version -contains $_ } { return $false }\r\n    'latest' { return $true }\r\n    default { return $true }\r\n  }\r\n}\r\n\r\n# @param $chef_url The url where we will download chef\r\n# @param $chef_msi Temporal MSI path\r\nfunction download_chef($chef_url, $chef_msi) {\r\n  Write-Host -NoNewline \"`r`tDownloading Chef...\"\r\n  (New-Object System.Net.WebClient).DownloadFile($chef_url, $chef_msi)\r\n  Write-Host -NoNewline \"`r`tDone!              \"\r\n}\r\n\r\n# function to install chef with sort of a nice progress bar\r\nfunction install_chef {\r\n  $proc_msi = Start-Process -FilePath 'msiexec.exe' -ArgumentList \"/qn /i $chef_msi\" -Passthru\r\n  $bar = \"\"\r\n  while (-Not $proc_msi.HasExited ) {\r\n    Write-Host -NoNewline \"`r`t[MSI] [$bar\"\r\n    Start-Sleep 2\r\n    $bar += \"#\"\r\n  }\r\n\r\n  if ($proc_msi.ExitCode -ne 0) {\r\n    throw \"msiexec was not successful. Received exit code $($proc_msi.ExitCode)\"\r\n  }\r\n  rm -r $chef_msi\r\n  Write-Host -NoNewline \"`r`t[MSI] [$bar] Completed!\r\n\"\r\n}\r\n\r\n  $chef_msi = $env:systemdrive + \"\\chef.msi\"\r\n\r\n  If (should_update_chef latest) {\r\n    Write-Host \"-----> Installing Chef Omnibus (latest)\r\n\"\r\n    download_chef \"http://www.chef.io/chef/install.msi?\" $chef_msi\r\n    install_chef\r\n  } else {\r\n    Write-Host \"-----> Chef Omnibus installation detected (latest)\r\n\"\r\n  }\r\n]\r\nREMOTE ERROR:\r\nmsiexec was not successful. Received exit code \r\nAt line:42 char:5\r\n+     throw \"msiexec was not successful. Received exit code \r\n$($proc_msi.ExitCode)\"\r\n```\r\nIt would appear as though Powershell is not actually returning anything in $proc_msi.ExitCode\r\n\r\nI'm not a windows developer, but I thought that powershell could not be relied on to return an exit code under all circumstances ?"},"comment":{"url":"https://api.github.com/repos/test-kitchen/test-kitchen/issues/comments/77713071","html_url":"https://github.com/test-kitchen/test-kitchen/issues/601#issuecomment-77713071","issue_url":"https://api.github.com/repos/test-kitchen/test-kitchen/issues/601","id":77713071,"user":{"login":"robcoward","id":5603418,"avatar_url":"https://avatars.githubusercontent.com/u/5603418?v=3","gravatar_id":"","url":"https://api.github.com/users/robcoward","html_url":"https://github.com/robcoward","followers_url":"https://api.github.com/users/robcoward/followers","following_url":"https://api.github.com/users/robcoward/following{/other_user}","gists_url":"https://api.github.com/users/robcoward/gists{/gist_id}","starred_url":"https://api.github.com/users/robcoward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robcoward/subscriptions","organizations_url":"https://api.github.com/users/robcoward/orgs","repos_url":"https://api.github.com/users/robcoward/repos","events_url":"https://api.github.com/users/robcoward/events{/privacy}","received_events_url":"https://api.github.com/users/robcoward/received_events","type":"User","site_admin":false},"created_at":"2015-03-07T22:06:41Z","updated_at":"2015-03-07T22:06:41Z","body":"@irabinovitch i dont believe that the version of vagrant is the issue here. Although i currently have v1.7.1 installed, at the time of reporting this issue i had v1.6.3, and the original report above specifies that this was observed with the kitchen-ec2 driver anyway, not vagrant."}}