WinRb / winrm-elevated

Runs PowerShell commands as elevated over Windows Remote Management (WinRM) via a scheduled task
Apache License 2.0
27 stars 17 forks source link

Chef run fails removing a temporary item when using winrm-elevated gem #12

Closed g0atcheez closed 7 years ago

g0atcheez commented 8 years ago

Hello,

Not sure if this is the proper place to put the issue, but here goes. I'm trying to converge a node in test-kitchen with the elevated: true flag set in my .kitchen.yml. The gem is at version 0.4.0. I am using this gem to install WMF 5 via updates and am also doing a reboot in the middle of the converge. The node converges fine aside from WMF 5 not installing if I do not use the elevated:true flag.

.kitchen.yml

driver: name: vagrant

provisioner: name: chef_zero require_chef_omnibus: 12.11 retry_on_exit_code:

platforms:

suites:

Debug output: C:\Users\mclark5\Documents\code\chef\nsm-chef\cookbooks\nsm_base [champion_cleanup +0 ~1 -0 !] λ kitchen converge -l debug -----> Starting Kitchen (v1.10.0) D [Vagrant command] BEGIN (vagrant --version) D [Vagrant command] END (0m0.00s) D [Vagrant command] BEGIN (vagrant plugin list) D [Vagrant command] END (0m0.00s) D Berksfile found at C:/Users/mclark5/Documents/code/chef/nsm-chef/cookbooks/nsm_base/Berksfile, loading Berkshelf D Berkshelf 4.3.5 library loaded D winrm requested, loading winrm gem (["~> 1.6"]) D winrm is loaded. D winrm-fs requested, loading winrm-fs gem (["~> 0.4.1"]) D winrm-fs is loaded. D winrm-elevated requested, loading winrm-elevated gem (["~> 0.4.0"]) D winrm-elevated is loaded. -----> Creating ... D is synchronizing on Kitchen::Driver::Vagrant#create D is messaging Kitchen::Driver::Vagrant#create D Creating Vagrantfile for (C:/Users/mclark5/Documents/code/chef/nsm-chef/cookbooks/nsm_base/.kitchen/kitchen-vagrant/kitchen-nsm_base-default-mwrock-Windows2012R2/Vagrantfile) D ------------ D Vagrant.configure("2") do |c| D c.berkshelf.enabled = false if Vagrant.has_plugin?("vagrant-berkshelf") D c.vm.box = "mwrock/Windows2012R2" D c.vm.synced_folder ".", "/vagrant", disabled: true D c.vm.provider :virtualbox do |p| D end D end D ------------ D [Vagrant command] BEGIN (vagrant up --no-provision --provider virtualbox) Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'mwrock/Windows2012R2'... ==> default: Matching MAC address for NAT networking... ==> default: Checking if box 'mwrock/Windows2012R2' is up to date... ==> default: Setting the name of the VM: kitchen-nsm_base-default-mwrock-Windows2012R2_default_1469137430647_70541 ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 5985 (guest) => 55985 (host) (adapter 1) default: 5986 (guest) => 55986 (host) (adapter 1) ==> default: Running 'pre-boot' VM customizations... ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: WinRM address: 127.0.0.1:55985 default: WinRM username: vagrant default: WinRM execution_time_limit: PT2H default: WinRM transport: plaintext ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... default: The guest additions on this VM do not match the installed version of default: VirtualBox! In most cases this is fine, but in rare cases it can default: prevent things such as shared folders from working properly. If you see default: shared folder errors, please make sure the guest additions within the default: virtual machine match the version of VirtualBox you have installed on default: your host and reload your VM. default: default: Guest Additions Version: 5.0.10 default: VirtualBox Version: 4.3 ==> default: Machine not provisioned because --no-provision is specified. D [Vagrant command] END (0m0.00s) D [Vagrant command] BEGIN (vagrant winrm-config) D [Vagrant command] END (0m0.00s) D [WinRM] opening remote shell on http://127.0.0.1:55985/wsman D [WinRM] remote shell 5A323B3F-7991-44A5-A1A2-991553AA6171 is open on http://127.0.0.1:55985/wsman D [WinRM] negotiate::http://127.0.0.1:55985/wsman<{:user=>"vagrant", :pass=>"vagrant", :elevated_username=>"vagrant", :elevated_password=>"vagrant", :no_ssl_peer_verification=>true, :disable_sspi=>false, :basic_auth_only=>false}> (Write-Host '[WinRM] Established ') D creating hash for file c:/windows/temp/winrm-elevated-shell-5890e9d5-3091-42b1-8923-2d11b781013e.ps1 D Running check_files.ps1 D @{ D "5131e5e8af04bb921e7dc0290319381e" = @{ D "target" = "c:/windows/temp/winrm-elevated-shell-5890e9d5-3091-42b1-8923-2d11b781013e.ps1"; D "src_basename" = "winrm-elevated-shell20160721-10068-jt6h1sps1"; D "dst" = "c:/windows/temp/winrm-elevated-shell-5890e9d5-3091-42b1-8923-2d11b781013e.ps1" D } D } D Parsing CSV Response D "chk_exists","src_md5","dst_md5","chk_dirty","verifies","target_is_folder" "False","5131e5e8af04bb921e7dc0290319381e",,"True","False","False"

D Uploading C:/Users/mclark5/AppData/Local/Temp/winrm-elevated-shell20160721-10068-jt6h1sps1 to encoded tmpfile $env:TEMP\b64-5131e5e8af04bb921e7dc0290319381e.txt D Finished uploading C:/Users/mclark5/AppData/Local/Temp/winrm-elevated-shell20160721-10068-jt6h1sps1 to encoded tmpfile $env:TEMP\b64-5131e5e8af04bb921e7dc0290319381e.txt (4.268 KB over 1 chunks) in (0m0.11s) D Running decode_files.ps1 D @{ D "$env:TEMP\b64-5131e5e8af04bb921e7dc0290319381e.txt" = @{ D "dst" = "c:/windows/temp/winrm-elevated-shell-5890e9d5-3091-42b1-8923-2d11b781013e.ps1" D } D } D Parsing CSV Response D "src_md5","tmpzip","verifies","tmpfile","dst_md5","dst" "5131e5e8af04bb921e7dc0290319381e",,"True","C:\Users\vagrant\AppData\Local\Temp\b64-5131e5e8af04bb921e7dc0290319381e.txt","5131e5e8af04bb921e7dc0290319381e","c:/windows/temp/winrm-elevated-shell-5890e9d5-3091-42b1-8923-2d11b781013e.ps1"

D Uploaded 1 items dirty_check: (0m1.44s) stream_files: (0m0.11s) decode: (0m1.72s) [WinRM] Established

   Vagrant instance <default-mwrock-Windows2012R2> created.
   Finished creating <default-mwrock-Windows2012R2> (4m35.49s).

-----> Converging ... Preparing files for transfer D Creating local sandbox in C:/Users/mclark5/AppData/Local/Temp/default-mwrock-Windows2012R2-sandbox-20160721-10068-6p16q8 Preparing dna.json D Creating dna.json from {:run_list=>["recipe[nsm_base::default]", "recipe[nsm_base::reboot]", "recipe[nsm_release_management::default]", "recipe[nsm_base::cleanup]"]} Resolving cookbook dependencies with Berkshelf 4.3.5... D Using Berksfile from C:/Users/mclark5/Documents/code/chef/nsm-chef/cookbooks/nsm_base/Berksfile Removing non-cookbook files before transfer Preparing data_bags D Using data_bags from C:/Users/mclark5/Documents/code/chef/nsm-chef/cookbooks/nsm_base/test/fixtures/data_bags Preparing validation.pem D Using a dummy validation.pem Preparing client.rb D Creating client.rb from {:node_name=>"default-mwrock-Windows2012R2", :checksum_path=>"#{ENV['TEMP']}\kitchen\checksums", :file_cache_path=>"#{ENV['TEMP']}\kitchen\cache", :file_backup_path=>"#{ENV['TEMP']}\kitchen\backup", :cookbook_path=>["#{ENV['TEMP']}\kitchen\cookbooks", "#{ENV['TEMP']}\kitchen\site-cookbooks"], :data_bag_path=>"#{ENV['TEMP']}\kitchen\data_bags", :environment_path=>"#{ENV['TEMP']}\kitchen\environments", :node_path=>"#{ENV['TEMP']}\kitchen\nodes", :role_path=>"#{ENV['TEMP']}\kitchen\roles", :client_path=>"#{ENV['TEMP']}\kitchen\clients", :user_path=>"#{ENV['TEMP']}\kitchen\users", :validation_key=>"#{ENV['TEMP']}\kitchen\validation.pem", :client_key=>"#{ENV['TEMP']}\kitchen\client.pem", :chef_server_url=>"http://127.0.0.1:8889", :encrypted_data_bag_secret=>"#{ENV['TEMP']}\kitchen\encrypted_data_bag_secret", :exit_status=>":enabled", :client_fork=>false, :named_run_list=>{}} D [WinRM] reusing existing connection negotiate::http://127.0.0.1:55985/wsman<{:user=>"vagrant", :pass=>"vagrant", :elevated_username=>"vagrant", :elevated_password=>"vagrant", :no_ssl_peer_verification=>true, :disable_sspi=>false, :basic_auth_only=>false}> D [WinRM] negotiate::http://127.0.0.1:55985/wsman<{:user=>"vagrant", :pass=>"vagrant", :elevated_username=>"vagrant", :elevated_password=>"vagrant", :no_ssl_peer_verification=>true, :disable_sspi=>false, :basic_auth_only=>false}> ($chef_omnibus_root = "$env:systemdrive\opscode\chef" $msi = "$env:TEMP\chef-12.11.msi" $chef_metadata_url = "https://omnitruck.chef.io/metadata?p=windows&m=x86_64&pv=2008r2&v=12.11" $pretty_version = "12.11" $version = "12.11"

Function Check-UpdateChef($root, $version) { if (-Not (Test-Path $root)) { return $true } elseif ("$version" -eq "true") { return $false } elseif ("$version" -eq "latest") { return $true }

Try { $chef_version = (Get-Content $root\version-manifest.txt -ErrorAction stop | select-object -first 1) } Catch { Try { $chef_version = (& $root\bin\chef-solo.bat -v) } Catch { $chef_version = " " } }

if ($chef_version.split(" ", 2)[1].StartsWith($version)) { return $false } else { return $true } }

Function Get-ChefMetadata($url) { Try { $response = ($c = Make-WebClient).DownloadString($url) } Finally { if ($c -ne $null) { $c.Dispose() } }

$md = ConvertFrom-StringData $response.Replace("`t", "=") return @($md.url, $md.sha256) }

Function Get-SHA256($src) { Try { $c = New-Object -TypeName System.Security.Cryptography.SHA256Managed $bytes = $c.ComputeHash(($in = (Get-Item $src).OpenRead())) return ([System.BitConverter]::ToString($bytes)).Replace("-", "").ToLower() } Finally { if (($c -ne $null) -and ($c.GetType().GetMethod("Dispose") -ne $null)) { $c.Dispose() }; if ($in -ne $null) { $in.Dispose() } } }

Function Download-Chef($url, $sha256, $dst) { Try { Log "Downloading package from $url" ($c = Make-WebClient).DownloadFile($url, $dst) Log "Download complete." } Finally { if ($c -ne $null) { $c.Dispose() } }

if ($sha256 -eq $null) { Log "Skipping sha256 verification" } elseif (($dsha256 = Get-SHA256 $dst) -eq $sha256) { Log "Successfully verified $dst" } else { throw "SHA256 for $dst $dsha256 does not match $sha256" } }

Function Install-Chef($msi) { Log "Installing Chef Omnibus package $msi" $installingChef = $True $installAttempts = 0 while ($installingChef) { $installAttempts++ $p = Start-Process -FilePath "msiexec.exe" -ArgumentList "/qn /i $msi" -Passthru -Wait $p.WaitForExit() if ($p.ExitCode -eq 1618) { Log "Another msi install is in progress (exit code 1618), retrying ($($installAttempts))..." continue } elseif ($p.ExitCode -ne 0) { throw "msiexec was not successful. Received exit code $($p.ExitCode)" } $installingChef = $False } Remove-Item $msi -Force Log "Installation complete" }

Function Log($m) { Write-Host " $m`n" }

Function Make-WebClient { $proxy = New-Object -TypeName System.Net.WebProxy $proxy.Address = $env:http_proxy $client = New-Object -TypeName System.Net.WebClient $client.Proxy = $proxy return $client }

Function Unresolve-Path($p) { if ($p -eq $null) { return $null } else { return $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($p) } }

$chef_omnibus_root = Unresolve-Path $chef_omnibus_root $msi = Unresolve-Path $msi

if (Check-UpdateChef $chef_omnibus_root $version) { Write-Host "-----> Installing Chef Omnibus ($pretty_version)n" if ($chef_metadata_url -ne $null) { $url, $sha256 = Get-ChefMetadata "$chef_metadata_url" } else { $url = $chef_msi_url $sha256 = $null } Download-Chef "$url" $sha256 $msi Install-Chef $msi } else { Write-Host "-----> Chef Omnibus installation detected ($pretty_version)n" } ) D creating hash for file $env:TEMP/default-mwrock-Windows2012R2-long_script.ps1 D Running check_files.ps1 D @{ D "6fb104735dbafac458bfdba6bef85519" = @{ D "target" = "$env:TEMP/default-mwrock-Windows2012R2-long_script.ps1"; D "src_basename" = "default-mwrock-Windows2012R2-long_script.ps1"; D "dst" = "$env:TEMP/default-mwrock-Windows2012R2-long_script.ps1" D } D } D Parsing CSV Response D "chk_exists","src_md5","dst_md5","chk_dirty","verifies","target_is_folder" "False","6fb104735dbafac458bfdba6bef85519",,"True","False","False"

D Uploading C:/Users/mclark5/AppData/Local/Temp/kitchen-long-script20160721-10068-1sy0vsw/default-mwrock-Windows2012R2-long_script.ps1 to encoded tmpfile $env:TEMP\b64-6fb104735dbafac458bfdba6bef85519.txt D Finished uploading C:/Users/mclark5/AppData/Local/Temp/kitchen-long-script20160721-10068-1sy0vsw/default-mwrock-Windows2012R2-long_script.ps1 to encoded tmpfile $env:TEMP\b64-6fb104735dbafac458bfdba6bef85519.txt (4.536 KB over 1 chunks) in (0m0.10s) D Running decode_files.ps1 D @{ D "$env:TEMP\b64-6fb104735dbafac458bfdba6bef85519.txt" = @{ D "dst" = "$env:TEMP/default-mwrock-Windows2012R2-long_script.ps1" D } D } D Parsing CSV Response D "src_md5","tmpzip","verifies","tmpfile","dst_md5","dst" "6fb104735dbafac458bfdba6bef85519",,"True","C:\Users\vagrant\AppData\Local\Temp\b64-6fb104735dbafac458bfdba6bef85519.txt","6fb104735dbafac458bfdba6bef85519","C:\Users\vagrant\AppData\Local\Temp/default-mwrock-Windows2012R2-long_script.ps1"

D Uploaded 1 items dirty_check: (0m1.24s) stream_files: (0m0.10s) decode: (0m1.33s) -----> Installing Chef Omnibus (12.11)

   Downloading package from https://packages.chef.io/stable/windows/2012r2/chef-client-12.11.18-1-x64.msi

   Download complete.

   Successfully verified C:\Users\vagrant\AppData\Local\Temp\chef-12.11.msi

   Installing Chef Omnibus package C:\Users\vagrant\AppData\Local\Temp\chef-12.11.msi

D [WinRM] retrying receive request after timeout Installation complete

D [WinRM] negotiate::http://127.0.0.1:55985/wsman<{:user=>"vagrant", :pass=>"vagrant", :elevated_username=>"vagrant", :elevated_password=>"vagrant", :no_ssl_peer_verification=>true, :disable_sspi=>false, :basic_auth_only=>false}> ($dirs = @("$env:TEMP\kitchen\clients", "$env:TEMP\kitchen\cookbooks", "$env:TEMP\kitchen\data", "$env:TEMP\kitchen\data_bags", "$env:TEMP\kitchen\encrypted_data_bag_secret", "$env:TEMP\kitchen\environments", "$env:TEMP\kitchen\roles") $root_path = "$env:TEMP\kitchen"

Function Delete-AllDirs($dirs) { $dirs | ForEach-Object { if (Test-Path ($path = Unresolve-Path $_)) { Remove-Item $path -Recurse -Force } } }

Function Unresolve-Path($p) { if ($p -eq $null) { return $null } else { return $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($p) } }

Function Make-RootPath($p) { $p = Unresolve-Path $p if (-Not (Test-Path $p)) { New-Item $p -ItemType directory | Out-Null } }

Delete-AllDirs $dirs Make-RootPath $root_path ) Transferring files to D creating hash for directory $env:TEMP\kitchen D Populating files D === All files added. D creating hash for file $env:TEMP\kitchen D creating hash for directory $env:TEMP\kitchen D Populating files D +++ Adding chef-vault/README.md D +++ Adding chef-vault/attributes/default.rb D +++ Adding chef-vault/libraries/chef_vault_secret.rb D +++ Adding chef-vault/libraries/helpers.rb D +++ Adding chef-vault/libraries/matchers.rb D +++ Adding chef-vault/metadata.json D +++ Adding chef-vault/recipes/default.rb D +++ Adding chef_handler/README.md D +++ Adding chef_handler/attributes/default.rb D +++ Adding chef_handler/files/default/handlers/README D +++ Adding chef_handler/libraries/helpers.rb D +++ Adding chef_handler/libraries/matchers.rb D +++ Adding chef_handler/metadata.json D +++ Adding chef_handler/providers/default.rb D +++ Adding chef_handler/recipes/default.rb D +++ Adding chef_handler/recipes/json_file.rb D +++ Adding chef_handler/resources/default.rb D +++ Adding ie/README.md D +++ Adding ie/attributes/default.rb D +++ Adding ie/libraries/default.rb D +++ Adding ie/metadata.json D +++ Adding ie/recipes/bfcache.rb D +++ Adding ie/recipes/esc.rb D +++ Adding ie/recipes/firstrun.rb D +++ Adding ie/recipes/zone.rb D +++ Adding ie/recipes/zoom.rb D +++ Adding ms_dotnet/README.md D +++ Adding ms_dotnet/attributes/default.rb D +++ Adding ms_dotnet/attributes/ms_dotnet2.rb D +++ Adding ms_dotnet/attributes/ms_dotnet3.rb D +++ Adding ms_dotnet/attributes/ms_dotnet4.rb D +++ Adding ms_dotnet/libraries/windows_version_helper.rb D +++ Adding ms_dotnet/metadata.json D +++ Adding ms_dotnet/recipes/default.rb D +++ Adding ms_dotnet/recipes/ms_dotnet2.rb D +++ Adding ms_dotnet/recipes/ms_dotnet3.rb D +++ Adding ms_dotnet/recipes/ms_dotnet4.rb D +++ Adding ms_dotnet/recipes/regiis.rb D +++ Adding nsm_base/README.md D +++ Adding nsm_base/attributes/default.rb D +++ Adding nsm_base/metadata.json D +++ Adding nsm_base/recipes/cleanup.rb D +++ Adding nsm_base/recipes/default.rb D +++ Adding nsm_base/recipes/packages.rb D +++ Adding nsm_base/recipes/reboot.rb D +++ Adding nsm_base/recipes/roles_features.rb D +++ Adding nsm_release_management/README.md D +++ Adding nsm_release_management/attributes/default.rb D +++ Adding nsm_release_management/metadata.json D +++ Adding nsm_release_management/recipes/default.rb D +++ Adding powershell/README.md D +++ Adding powershell/attributes/bits_4.rb D +++ Adding powershell/attributes/config_lcm.rb D +++ Adding powershell/attributes/default.rb D +++ Adding powershell/attributes/powershell2.rb D +++ Adding powershell/attributes/powershell3.rb D +++ Adding powershell/attributes/powershell4.rb D +++ Adding powershell/attributes/powershell5.rb D +++ Adding powershell/libraries/powershell_module_provider.rb D +++ Adding powershell/libraries/powershell_module_resource.rb D +++ Adding powershell/libraries/powershell_version.rb D +++ Adding powershell/metadata.json D +++ Adding powershell/providers/default.rb D +++ Adding powershell/recipes/default.rb D +++ Adding powershell/recipes/disable_lcm.rb D +++ Adding powershell/recipes/dsc.rb D +++ Adding powershell/recipes/enable_dsc_script.rb D +++ Adding powershell/recipes/enable_lcm.rb D +++ Adding powershell/recipes/powershell2.rb D +++ Adding powershell/recipes/powershell3.rb D +++ Adding powershell/recipes/powershell4.rb D +++ Adding powershell/recipes/powershell5.rb D +++ Adding powershell/recipes/powershell_module.rb D +++ Adding powershell/recipes/windows_reboot.rb D +++ Adding powershell/recipes/winrm.rb D +++ Adding powershell/resources/default.rb D +++ Adding windows/README.md D +++ Adding windows/attributes/default.rb D +++ Adding windows/files/default/handlers/windows_reboot_handler.rb D +++ Adding windows/libraries/feature_base.rb D +++ Adding windows/libraries/matchers.rb D +++ Adding windows/libraries/powershell_helper.rb D +++ Adding windows/libraries/powershell_out.rb D +++ Adding windows/libraries/registry_helper.rb D +++ Adding windows/libraries/version.rb D +++ Adding windows/libraries/windows_architecture_helper.rb D +++ Adding windows/libraries/windows_helper.rb D +++ Adding windows/libraries/windows_package.rb D +++ Adding windows/libraries/windows_privileged.rb D +++ Adding windows/libraries/wmi_helper.rb D +++ Adding windows/metadata.json D +++ Adding windows/providers/auto_run.rb D +++ Adding windows/providers/batch.rb D +++ Adding windows/providers/certificate.rb D +++ Adding windows/providers/certificate_binding.rb D +++ Adding windows/providers/feature_dism.rb D +++ Adding windows/providers/feature_powershell.rb D +++ Adding windows/providers/feature_servermanagercmd.rb D +++ Adding windows/providers/font.rb D +++ Adding windows/providers/http_acl.rb D +++ Adding windows/providers/pagefile.rb D +++ Adding windows/providers/path.rb D +++ Adding windows/providers/printer.rb D +++ Adding windows/providers/printer_port.rb D +++ Adding windows/providers/reboot.rb D +++ Adding windows/providers/registry.rb D +++ Adding windows/providers/shortcut.rb D +++ Adding windows/providers/task.rb D +++ Adding windows/providers/zipfile.rb D +++ Adding windows/recipes/default.rb D +++ Adding windows/recipes/reboot_handler.rb D +++ Adding windows/resources/auto_run.rb D +++ Adding windows/resources/batch.rb D +++ Adding windows/resources/certificate.rb D +++ Adding windows/resources/certificate_binding.rb D +++ Adding windows/resources/feature.rb D +++ Adding windows/resources/font.rb D +++ Adding windows/resources/http_acl.rb D +++ Adding windows/resources/pagefile.rb D +++ Adding windows/resources/path.rb D +++ Adding windows/resources/printer.rb D +++ Adding windows/resources/printer_port.rb D +++ Adding windows/resources/reboot.rb D +++ Adding windows/resources/registry.rb D +++ Adding windows/resources/shortcut.rb D +++ Adding windows/resources/task.rb D +++ Adding windows/resources/zipfile.rb D === All files added. D creating hash for directory $env:TEMP\kitchen D Populating files D +++ Adding passwords/tfsdeployagent.json D === All files added. D creating hash for file $env:TEMP\kitchen D creating hash for file $env:TEMP\kitchen D Running check_files.ps1 D @{ D "76cdb2bad9582d23c1f6f4d868218d6c" = @{ D "target" = "$env:TEMP\winrm-upload\tmpzip-76cdb2bad9582d23c1f6f4d868218d6c.zip"; D "src_basename" = "cache"; D "dst" = "$env:TEMP\kitchen\cache" D }; D "f9bcbc369ba9e8ca050fe1651454c059" = @{ D "target" = "$env:TEMP\kitchen"; D "src_basename" = "client.rb"; D "dst" = "$env:TEMP\kitchen" D }; D "e221c19fbfb869a97f9fe99e9a135894" = @{ D "target" = "$env:TEMP\winrm-upload\tmpzip-e221c19fbfb869a97f9fe99e9a135894.zip"; D "src_basename" = "cookbooks"; D "dst" = "$env:TEMP\kitchen\cookbooks" D }; D "b3d48e16f0ce10105796832d0b8fc143" = @{ D "target" = "$env:TEMP\winrm-upload\tmpzip-b3d48e16f0ce10105796832d0b8fc143.zip"; D "src_basename" = "data_bags"; D "dst" = "$env:TEMP\kitchen\data_bags" D }; D "5bc417a36c15e81035deb7dd2d6fbefc" = @{ D "target" = "$env:TEMP\kitchen"; D "src_basename" = "dna.json"; D "dst" = "$env:TEMP\kitchen" D }; D "49abb94825cb80b9a9cd59e5f76daf4a" = @{ D "target" = "$env:TEMP\kitchen"; D "src_basename" = "validation.pem"; D "dst" = "$env:TEMP\kitchen" D } D } D Parsing CSV Response D "chk_exists","src_md5","dst_md5","chk_dirty","verifies","target_is_folder" "False","76cdb2bad9582d23c1f6f4d868218d6c",,"True","False","False" "False","f9bcbc369ba9e8ca050fe1651454c059",,"True","False","True" "False","5bc417a36c15e81035deb7dd2d6fbefc",,"True","False","True" "False","49abb94825cb80b9a9cd59e5f76daf4a",,"True","False","True" "False","e221c19fbfb869a97f9fe99e9a135894",,"True","False","False" "False","b3d48e16f0ce10105796832d0b8fc143",,"True","False","False"

D Uploading C:/Users/mclark5/AppData/Local/Temp/tmpzip-20160721-10068-1ut6laf.zip to encoded tmpfile $env:TEMP\b64-76cdb2bad9582d23c1f6f4d868218d6c.txt D Finished uploading C:/Users/mclark5/AppData/Local/Temp/tmpzip-20160721-10068-1ut6laf.zip to encoded tmpfile $env:TEMP\b64-76cdb2bad9582d23c1f6f4d868218d6c.txt (0.028 KB over 1 chunks) in (0m0.13s) D Uploading C:/Users/mclark5/AppData/Local/Temp/default-mwrock-Windows2012R2-sandbox-20160721-10068-6p16q8/client.rb to encoded tmpfile $env:TEMP\b64-f9bcbc369ba9e8ca050fe1651454c059.txt D Finished uploading C:/Users/mclark5/AppData/Local/Temp/default-mwrock-Windows2012R2-sandbox-20160721-10068-6p16q8/client.rb to encoded tmpfile $env:TEMP\b64-f9bcbc369ba9e8ca050fe1651454c059.txt (1.136 KB over 1 chunks) in (0m0.12s) D Uploading C:/Users/mclark5/AppData/Local/Temp/tmpzip-20160721-10068-13rvw9a.zip to encoded tmpfile $env:TEMP\b64-e221c19fbfb869a97f9fe99e9a135894.txt D Wrote chunk 25 for $env:TEMP\b64-e221c19fbfb869a97f9fe99e9a135894.txt D Finished uploading C:/Users/mclark5/AppData/Local/Temp/tmpzip-20160721-10068-13rvw9a.zip to encoded tmpfile $env:TEMP\b64-e221c19fbfb869a97f9fe99e9a135894.txt (219.336 KB over 28 chunks) in (0m1.61s) D Uploading C:/Users/mclark5/AppData/Local/Temp/tmpzip-20160721-10068-k1k3f9.zip to encoded tmpfile $env:TEMP\b64-b3d48e16f0ce10105796832d0b8fc143.txt D Finished uploading C:/Users/mclark5/AppData/Local/Temp/tmpzip-20160721-10068-k1k3f9.zip to encoded tmpfile $env:TEMP\b64-b3d48e16f0ce10105796832d0b8fc143.txt (0.288 KB over 1 chunks) in (0m0.12s) D Uploading C:/Users/mclark5/AppData/Local/Temp/default-mwrock-Windows2012R2-sandbox-20160721-10068-6p16q8/dna.json to encoded tmpfile $env:TEMP\b64-5bc417a36c15e81035deb7dd2d6fbefc.txt D Finished uploading C:/Users/mclark5/AppData/Local/Temp/default-mwrock-Windows2012R2-sandbox-20160721-10068-6p16q8/dna.json to encoded tmpfile $env:TEMP\b64-5bc417a36c15e81035deb7dd2d6fbefc.txt (0.184 KB over 1 chunks) in (0m0.11s) D Uploading C:/Users/mclark5/AppData/Local/Temp/default-mwrock-Windows2012R2-sandbox-20160721-10068-6p16q8/validation.pem to encoded tmpfile $env:TEMP\b64-49abb94825cb80b9a9cd59e5f76daf4a.txt D Finished uploading C:/Users/mclark5/AppData/Local/Temp/default-mwrock-Windows2012R2-sandbox-20160721-10068-6p16q8/validation.pem to encoded tmpfile $env:TEMP\b64-49abb94825cb80b9a9cd59e5f76daf4a.txt (2.236 KB over 1 chunks) in (0m0.12s) D Running decode_files.ps1 D @{ D "$env:TEMP\b64-76cdb2bad9582d23c1f6f4d868218d6c.txt" = @{ D "dst" = "$env:TEMP\kitchen\cache"; D "tmpzip" = "$env:TEMP\winrm-upload\tmpzip-76cdb2bad9582d23c1f6f4d868218d6c.zip" D }; D "$env:TEMP\b64-f9bcbc369ba9e8ca050fe1651454c059.txt" = @{ D "dst" = "$env:TEMP\kitchen/client.rb" D }; D "$env:TEMP\b64-e221c19fbfb869a97f9fe99e9a135894.txt" = @{ D "dst" = "$env:TEMP\kitchen\cookbooks"; D "tmpzip" = "$env:TEMP\winrm-upload\tmpzip-e221c19fbfb869a97f9fe99e9a135894.zip" D }; D "$env:TEMP\b64-b3d48e16f0ce10105796832d0b8fc143.txt" = @{ D "dst" = "$env:TEMP\kitchen\data_bags"; D "tmpzip" = "$env:TEMP\winrm-upload\tmpzip-b3d48e16f0ce10105796832d0b8fc143.zip" D }; D "$env:TEMP\b64-5bc417a36c15e81035deb7dd2d6fbefc.txt" = @{ D "dst" = "$env:TEMP\kitchen/dna.json" D }; D "$env:TEMP\b64-49abb94825cb80b9a9cd59e5f76daf4a.txt" = @{ D "dst" = "$env:TEMP\kitchen/validation.pem" D } D } D Parsing CSV Response D "src_md5","tmpzip","verifies","tmpfile","dst_md5","dst" "76cdb2bad9582d23c1f6f4d868218d6c","C:\Users\vagrant\AppData\Local\Temp\winrm-upload\tmpzip-76cdb2bad9582d23c1f6f4d868218d6c.zip","True","C:\Users\vagrant\AppData\Local\Temp\b64-76cdb2bad9582d23c1f6f4d868218d6c.txt","76cdb2bad9582d23c1f6f4d868218d6c","C:\Users\vagrant\AppData\Local\Temp\kitchen\cache" "e221c19fbfb869a97f9fe99e9a135894","C:\Users\vagrant\AppData\Local\Temp\winrm-upload\tmpzip-e221c19fbfb869a97f9fe99e9a135894.zip","True","C:\Users\vagrant\AppData\Local\Temp\b64-e221c19fbfb869a97f9fe99e9a135894.txt","e221c19fbfb869a97f9fe99e9a135894","C:\Users\vagrant\AppData\Local\Temp\kitchen\cookbooks" "5bc417a36c15e81035deb7dd2d6fbefc",,"True","C:\Users\vagrant\AppData\Local\Temp\b64-5bc417a36c15e81035deb7dd2d6fbefc.txt","5bc417a36c15e81035deb7dd2d6fbefc","C:\Users\vagrant\AppData\Local\Temp\kitchen/dna.json" "b3d48e16f0ce10105796832d0b8fc143","C:\Users\vagrant\AppData\Local\Temp\winrm-upload\tmpzip-b3d48e16f0ce10105796832d0b8fc143.zip","True","C:\Users\vagrant\AppData\Local\Temp\b64-b3d48e16f0ce10105796832d0b8fc143.txt","b3d48e16f0ce10105796832d0b8fc143","C:\Users\vagrant\AppData\Local\Temp\kitchen\data_bags" "f9bcbc369ba9e8ca050fe1651454c059",,"True","C:\Users\vagrant\AppData\Local\Temp\b64-f9bcbc369ba9e8ca050fe1651454c059.txt","f9bcbc369ba9e8ca050fe1651454c059","C:\Users\vagrant\AppData\Local\Temp\kitchen/client.rb" "49abb94825cb80b9a9cd59e5f76daf4a",,"True","C:\Users\vagrant\AppData\Local\Temp\b64-49abb94825cb80b9a9cd59e5f76daf4a.txt","49abb94825cb80b9a9cd59e5f76daf4a","C:\Users\vagrant\AppData\Local\Temp\kitchen/validation.pem"

D Cleaned up src_zip C:/Users/mclark5/AppData/Local/Temp/tmpzip-20160721-10068-1ut6laf.zip D Cleaned up src_zip C:/Users/mclark5/AppData/Local/Temp/tmpzip-20160721-10068-13rvw9a.zip D Cleaned up src_zip C:/Users/mclark5/AppData/Local/Temp/tmpzip-20160721-10068-k1k3f9.zip D Uploaded 6 items dirty_check: (0m1.74s) stream_files: (0m2.22s) decode: (0m3.01s) D Transfer complete D Attempting to execute command - try 1 of 1. D [WinRM] negotiate::http://127.0.0.1:55985/wsman<{:user=>"vagrant", :pass=>"vagrant", :elevated_username=>"vagrant", :elevated_password=>"vagrant", :no_ssl_peer_verification=>true, :disable_sspi=>false, :basic_auth_only=>false}> ($env:PATH = [System.Environment]::GetEnvironmentVariable("PATH","Machine")

& $env:systemdrive\opscode\chef\bin\chef-client.bat --local-mode --config $env:TEMP\kitchen\client.rb --log_level auto --force-formatter --no-color --json-attributes $env:TEMP\kitchen\dna.json --chef-zero-port 8889 ; exit $LastExitCode)

   Starting Chef Client, version 12.11.18
   Creating a new client identity for default-mwrock-Windows2012R2 using the validator key.
   resolving cookbooks for run list: ["nsm_base::default", "nsm_base::reboot", "nsm_release_management::default", "nsm_base::cleanup"]
   Synchronizing Cookbooks:

     - nsm_release_management (0.1.1)
     - ie (2.1.2)
     - windows (1.44.1)
     - powershell (3.3.2)
     - ms_dotnet (2.6.2)
     - chef-vault (1.3.3)
     - chef_handler (1.4.0)
   Installing Cookbook Gems:
   Compiling Cookbooks...
   Recipe: chef-vault::default
     * chef_gem[chef-vault] action install
       - install version ~> 2.6 of package chef-vault
   [2016-07-21T21:49:53+00:00] WARN: PowerShell 2.0 is not supported or already installed on this version of Windows: 6.3.9600
   [2016-07-21T21:49:53+00:00] WARN: Please use the package resource available in Chef Client 12.6.
   windows_package will be removed in the next major version release
   of the Windows cookbook.

   [2016-07-21T21:49:53+00:00] WARN: Please use the package resource available in Chef Client 12.6.
   windows_package will be removed in the next major version release
   of the Windows cookbook.

   [2016-07-21T21:49:53+00:00] WARN: Cloning resource attributes for directory[C:\Windows\Temp\Chef] from prior resource (CHEF-3694)
   [2016-07-21T21:49:53+00:00] WARN: Previous directory[C:\Windows\Temp\Chef]: C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/nsm_release_management/recipes/default.rb:10:in `from_file'
   [2016-07-21T21:49:53+00:00] WARN: Current  directory[C:\Windows\Temp\Chef]: C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/nsm_base/recipes/cleanup.rb:1:in `from_file'
     Converging 28 resources
   Recipe: nsm_base::default
     * directory[C:\Windows\Temp\Chef] action create
       - create new directory C:\Windows\Temp\Chef
   Recipe: chef-vault::default
     * chef_gem[chef-vault] action install (up to date)
   Recipe: ie::esc
     * registry_key[HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}] action create (up to date)
     * registry_key[HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}] action create (up to date)
     * registry_key[HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\ChefIE_ESCZoneMap_IEHarden] action create
       - create key HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\ChefIE_ESCZoneMap_IEHarden
       - set value {:name=>"Version", :type=>:string, :data=>1469137793}
       - set value {:name=>"StubPath", :type=>:string, :data=>"reg add \"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\" /v IEHarden /d 0 /t REG_DWORD /f"}
   Recipe: ie::firstrun
     * registry_key[HKLM\SOFTWARE\Policies\Microsoft\Internet Explorer\Main] action create
       - create key HKLM\SOFTWARE\Policies\Microsoft\Internet Explorer\Main
       - set value {:name=>"DisableFirstRunCustomize", :type=>:dword, :data=>1}
     * registry_key[HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\ChefIE_FirstRun_DisableFirstRunCustomize] action create
       - create key HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\ChefIE_FirstRun_DisableFirstRunCustomize
       - set value {:name=>"Version", :type=>:string, :data=>1469137793}
       - set value {:name=>"StubPath", :type=>:string, :data=>"reg add \"HKCU\\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\\Main\" /v DisableFirstRunCustomize /d 1 /t REG_DWORD /f"}
   Recipe: windows::default
     * chef_gem[win32-api] action install (up to date)
     * chef_gem[win32-service] action install (up to date)
     * chef_gem[windows-api] action install (up to date)
     * chef_gem[windows-pr] action install
       - install version 1.2.5 of package windows-pr
     * chef_gem[win32-dir] action install (up to date)
     * chef_gem[win32-event] action install
     * chef_gem[win32-mutex] action install (up to date)
   Recipe: ms_dotnet::ms_dotnet4
     * windows_feature[netFx4] action install
   Recipe: ms_dotnet::ms_dotnet2
     * log[.NET Framework 2.0 is already enabled on this version of Windows] action write[2016-07-21T21:50:14+00:00] WARN: .NET Framework 2.0 is already enabled on this version of Windows

   Recipe: powershell::powershell5
     * windows_package[Windows Management Framework Core 5.0] action install
     Recipe: <Dynamically Defined Resource>
       * remote_file[C:\Users\vagrant\AppData\Local\Temp\kitchen\cache\package\Win8.1AndW2K12R2-KB3134758-x64.msu] action create
         - create new file C:\Users\vagrant\AppData\Local\Temp\kitchen\cache\package\Win8.1AndW2K12R2-KB3134758-x64.msu
         - update content in file C:\Users\vagrant\AppData\Local\Temp\kitchen\cache\package\Win8.1AndW2K12R2-KB3134758-x64.msu from none to bb6af4
         (file sizes exceed 10000000 bytes, diff output suppressed)

D [WinRM] retrying receive request after timeout D [WinRM] retrying receive request after timeout D [WinRM] retrying receive request after timeout

     * windows_feature[TelnetClient] action install

   Recipe: nsm_base::reboot
     * file[C:\Windows\Temp\Chef\reboot] action create_if_missing
       - create new file C:\Windows\Temp\Chef\reboot
     * reboot[now] action reboot_now[2016-07-21T21:55:16+00:00] WARN: Rebooting system immediately, requested by 'now'

       Running handlers:
       Running handlers complete

       Deprecated features used!
         Using an LWRP provider by its name (WindowsFeatureDism) directly is no longer supported in Chef 12 and will be removed.  Use Chef::ProviderResolver.new(node, resource, action) instead. at 1 location:
    - C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/windows/resources/feature.rb:32:in `initialize'

       Chef Client finished, 12/22 resources updated in 06 minutes 05 seconds
   [2016-07-21T21:55:16+00:00] WARN: Rebooting server at a recipe's request. Details: {:delay_mins=>0, :reason=>"Chef requested reboot", :timestamp=>2016-07-21 21:55:16 +0000, :requested_by=>"now"}

       Running handlers:
   [2016-07-21T21:55:16+00:00] ERROR: Running exception handlers
       Running handlers complete
   [2016-07-21T21:55:16+00:00] ERROR: Exception handlers complete
       Chef Client failed. 12 resources updated in 06 minutes 05 seconds
   [2016-07-21T21:55:16+00:00] FATAL: Stacktrace dumped to C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/chef-stacktrace.out
   [2016-07-21T21:55:16+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
   [2016-07-21T21:55:16+00:00] FATAL: Chef::Exceptions::Reboot: Rebooting server at a recipe's request. Details: {:delay_mins=>0, :reason=>"Chef requested reboot", :timestamp=>2016-07-21 21:55:16 +0000, :requested_by=>"now"}

$$$$$$ C:/opscode/chef/embedded/lib/ruby/2.1.0/x64-mingw32/dl.so: warning: already initialized constant DL::RUBY_FREE $$$$$$ C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-3.1.1/lib/net/ssh/authentication/pageant.rb:16: warning: previous definition of RUBY_FREE was here $$$$$$ DL is deprecated, please use Fiddle $$$$$$ del : Cannot remove item C:\Users\vagrant\AppData\Local\Temp\tmpD7D3.tmp: The $$$$$$ process cannot access the file $$$$$$ 'C:\Users\vagrant\AppData\Local\Temp\tmpD7D3.tmp' because it is being used by $$$$$$ another process. $$$$$$ At C:\windows\temp\winrm-elevated-shell-5890e9d5-3091-42b1-8923-2d11b781013e.ps $$$$$$ 1:99 char:1 $$$$$$ + del $out_file $$$$$$ + ~~~~~ $$$$$$ + CategoryInfo : WriteError: (C:\Users\vagran...emp\tmpD7D3.tmp:F $$$$$$ ileInfo) [Remove-Item], IOException $$$$$$ + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell $$$$$$ .Commands.RemoveItemCommand D Cleaning up local sandbox in C:/Users/mclark5/AppData/Local/Temp/default-mwrock-Windows2012R2-sandbox-20160721-10068-6p16q8

------Exception------- Class: Kitchen::ActionFailed Message: 1 actions failed.

Converge failed on instance . Please see .kitchen/logs/default-mwrock-Windows2012R2.log for more details

Please see .kitchen/logs/kitchen.log for more details Also try running kitchen diagnose --all for configuration

D ------Exception------- D Class: Kitchen::ActionFailed D Message: 1 actions failed.

Converge failed on instance <default-mwrock-Windows2012R2>.  Please see .kitchen/logs/default-mwrock-Windows2012R2.log for more details

D ---------------------- D ------Backtrace------- D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/command.rb:187:in report_errors' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/command.rb:178:inrun_action' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/command/action.rb:39:in block in call' D C:/chefdk/chefdk/embedded/lib/ruby/2.1.0/benchmark.rb:279:inmeasure' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/command/action.rb:37:in call' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/cli.rb:56:inperform' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/cli.rb:184:in block (2 levels) in <class:CLI>' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:inrun' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/cli.rb:325:ininvoke_task' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:instart' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/bin/kitchen:13:in block in <top (required)>' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/errors.rb:174:inwith_friendly_errors' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/bin/kitchen:13:in <top (required)>' D C:/chefdk/chefdk/bin/kitchen:20:inload' D C:/chefdk/chefdk/bin/kitchen:20:in <main>' D ----End Backtrace----- D -Composite Exception-- D Class: Kitchen::InstanceFailure D Message: Converge failed on instance <default-mwrock-Windows2012R2>. Please see .kitchen/logs/default-mwrock-Windows2012R2.log for more details D ---------------------- D ------Backtrace------- D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/provisioner/base.rb:86:inrescue in call' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/provisioner/base.rb:89:in call' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:373:inblock in converge_action' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:513:in call' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:513:insynchronize_or_call' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:478:in block in action' D C:/chefdk/chefdk/embedded/lib/ruby/2.1.0/benchmark.rb:279:inmeasure' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:477:in action' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:369:inconverge_action' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:348:in block in transition_to' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:347:ineach' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:347:in transition_to' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:138:inconverge' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/command.rb:201:in public_send' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/command.rb:201:inrun_action_in_thread' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/command.rb:173:in block (2 levels) in run_action' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:incall' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:in `block in create_with_logging_context' D ----End Backtrace----- D ---Nested Exception--- D Class: Kitchen::ActionFailed D Message: WinRM exited (259) for command: [$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH","Machine")

& $env:systemdrive\opscode\chef\bin\chef-client.bat --local-mode --config $env:TEMP\kitchen\client.rb --log_level auto --force-formatter --no-color --json-attributes $env:TEMP\kitchen\dna.json --chef-zero-port 8889 ; exit $LastExitCode]

D ---------------------- D ------Backtrace------- D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/provisioner/base.rb:86:in rescue in call' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/provisioner/base.rb:89:incall' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:373:in block in converge_action' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:513:incall' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:513:in synchronize_or_call' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:478:inblock in action' D C:/chefdk/chefdk/embedded/lib/ruby/2.1.0/benchmark.rb:279:in measure' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:477:inaction' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:369:in converge_action' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:348:inblock in transition_to' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:347:in each' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:347:intransition_to' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/instance.rb:138:in converge' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/command.rb:201:inpublic_send' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/command.rb:201:in run_action_in_thread' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/test-kitchen-1.10.0/lib/kitchen/command.rb:173:inblock (2 levels) in run_action' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:in call' D C:/chefdk/chefdk/embedded/lib/ruby/gems/2.1.0/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:inblock in create_with_logging_context' D ----End Backtrace----- D [WinRM] closing remote shell 5A323B3F-7991-44A5-A1A2-991553AA6171 on http://127.0.0.1:55985/wsman D [WinRM] remote shell 5A323B3F-7991-44A5-A1A2-991553AA6171 closed

keithbaker commented 8 years ago

I'm seeing the same issue. The delete is trying to remove the output and error files before they are closed.

https://github.com/WinRb/winrm-elevated path: winrm-elevated/lib/winrm-elevated/scripts/elevated_shell.ps1

Let me know if I can offer any additional information.

jsco2t commented 8 years ago

This issue also reproduces for me. It seems to commonly happen (for me) if the reboot resource fires and triggers a reboot.

lgeinert commented 7 years ago

We are also experiencing this, interestingly its only when using kitchen-openstack driver and not when we are using vagrant.

kelsosharp commented 5 years ago

This happens to me using vagrant as well