Skip to content

Instantly share code, notes, and snippets.

@alininja
Created August 18, 2015 19:52
Show Gist options
  • Save alininja/0c212b01cff906a5b85d to your computer and use it in GitHub Desktop.
Save alininja/0c212b01cff906a5b85d to your computer and use it in GitHub Desktop.
Chef Kitchen can't converge with Windows winrm
I, [2015-08-18T08:56:06.351051 #7010] INFO -- Kitchen: -----> Starting Kitchen (v1.4.0)
I, [2015-08-18T08:56:07.738878 #7010] INFO -- Kitchen: -----> Creating <default-windows-2008r2>...
I, [2015-08-18T08:57:28.013755 #7010] INFO -- Kitchen: -----> Converging <default-windows-2008r2>...
E, [2015-08-18T09:25:42.328957 #7010] ERROR -- Kitchen: ------Exception-------
E, [2015-08-18T09:25:42.329015 #7010] ERROR -- Kitchen: Class: Kitchen::ActionFailed
E, [2015-08-18T09:25:42.329038 #7010] ERROR -- Kitchen: Message: Failed to complete #converge action: [[WinRM::Transport::FileTransporter] Upload failed (exitcode: 1)
#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">The term 'Function' is not recognized as the name of a cmdlet, function, script_x000D__x000A_</S><S S="Error"> file, or operable program. Check the spelling of the name, or if a path was in_x000D__x000A_</S><S S="Error">cluded, verify that the path is correct and try again._x000D__x000A_</S><S S="Error">At line:3 char:2_x000D__x000A_</S><S S="Error">+ . &lt;&lt;&lt;&lt; Function Cleanup($o) { if (($o) -and ($o.GetType().GetMethod("Dispose_x000D__x000A_</S><S S="Error">") -ne $null)) { $o.Dispose() } }_x000D__x000A_</S><S S="Error"> + CategoryInfo : ObjectNotFound: (Function:String) [], CommandNot _x000D__x000A_</S><S S="Error"> FoundException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : CommandNotFoundException_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S><S S="Error">Exception calling "FromBase64String" with "1" argument(s): "Invalid character i_x000D__x000A_</S><S S="Error">n a Base-64 string."_x000D__x000A_</S><S S="Error">At line:4 char:114_x000D__x000A_</S><S S="Error">+ Function Decode-Base64File($src, $dst) {set-content -Encoding Byte -Path $dst_x000D__x000A_</S><S S="Error"> -Value ([Convert]::FromBase64String &lt;&lt;&lt;&lt; ([IO.File]::ReadAllLines($src)))}_x000D__x000A_</S><S S="Error"> + CategoryInfo : NotSpecified: (:) [], MethodInvocationException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : DotNetMethodException_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S><S S="Error">Get-Item : Cannot find path 'C:\Users\vagrant\AppData\Local\Temp\tmpzip-3395dca_x000D__x000A_</S><S S="Error">1ace537199fc6ec84fb894f56.zip' because it does not exist._x000D__x000A_</S><S S="Error">At line:30 char:45_x000D__x000A_</S><S S="Error">+ $bytes = $c.ComputeHash(($in = (Get-Item &lt;&lt;&lt;&lt; $src).OpenRead()))_x000D__x000A_</S><S S="Error"> + CategoryInfo : ObjectNotFound: (C:\Users\vagran...c84fb894f56.z _x000D__x000A_</S><S S="Error"> ip:String) [Get-Item], ItemNotFoundException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetIt _x000D__x000A_</S><S S="Error"> emCommand_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S><S S="Error">The term 'Cleanup' is not recognized as the name of a cmdlet, function, script _x000D__x000A_</S><S S="Error">file, or operable program. Check the spelling of the name, or if a path was inc_x000D__x000A_</S><S S="Error">luded, verify that the path is correct and try again._x000D__x000A_</S><S S="Error">At line:32 char:50_x000D__x000A_</S><S S="Error">+ } catch [exception]{throw $_} finally { Cleanup &lt;&lt;&lt;&lt; $c; Cleanup $in }_x000D__x000A_</S><S S="Error"> + CategoryInfo : ObjectNotFound: (Cleanup:String) [], CommandNotF _x000D__x000A_</S><S S="Error"> oundException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : CommandNotFoundException_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S><S S="Error">The term 'Cleanup' is not recognized as the name of a cmdlet, function, script _x000D__x000A_</S><S S="Error">file, or operable program. Check the spelling of the name, or if a path was inc_x000D__x000A_</S><S S="Error">luded, verify that the path is correct and try again._x000D__x000A_</S><S S="Error">At line:32 char:62_x000D__x000A_</S><S S="Error">+ } catch [exception]{throw $_} finally { Cleanup $c; Cleanup &lt;&lt;&lt;&lt; $in }_x000D__x000A_</S><S S="Error"> + CategoryInfo : ObjectNotFound: (Cleanup:String) [], CommandNotF _x000D__x000A_</S><S S="Error"> oundException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : CommandNotFoundException_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S><S S="Error">You cannot call a method on a null-valued expression._x000D__x000A_</S><S S="Error">At line:30 char:60_x000D__x000A_</S><S S="Error">+ $bytes = $c.ComputeHash(($in = (Get-Item $src).OpenRead &lt;&lt;&lt;&lt; ()))_x000D__x000A_</S><S S="Error"> + CategoryInfo : InvalidOperation: (OpenRead:String) [], RuntimeE _x000D__x000A_</S><S S="Error"> xception_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : InvokeMethodOnNull_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S></Objs>]
E, [2015-08-18T09:25:42.329066 #7010] ERROR -- Kitchen: ---Nested Exception---
E, [2015-08-18T09:25:42.329084 #7010] ERROR -- Kitchen: Class: WinRM::Transport::FileTransporterFailed
E, [2015-08-18T09:25:42.329101 #7010] ERROR -- Kitchen: Message: [WinRM::Transport::FileTransporter] Upload failed (exitcode: 1)
#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">The term 'Function' is not recognized as the name of a cmdlet, function, script_x000D__x000A_</S><S S="Error"> file, or operable program. Check the spelling of the name, or if a path was in_x000D__x000A_</S><S S="Error">cluded, verify that the path is correct and try again._x000D__x000A_</S><S S="Error">At line:3 char:2_x000D__x000A_</S><S S="Error">+ . &lt;&lt;&lt;&lt; Function Cleanup($o) { if (($o) -and ($o.GetType().GetMethod("Dispose_x000D__x000A_</S><S S="Error">") -ne $null)) { $o.Dispose() } }_x000D__x000A_</S><S S="Error"> + CategoryInfo : ObjectNotFound: (Function:String) [], CommandNot _x000D__x000A_</S><S S="Error"> FoundException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : CommandNotFoundException_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S><S S="Error">Exception calling "FromBase64String" with "1" argument(s): "Invalid character i_x000D__x000A_</S><S S="Error">n a Base-64 string."_x000D__x000A_</S><S S="Error">At line:4 char:114_x000D__x000A_</S><S S="Error">+ Function Decode-Base64File($src, $dst) {set-content -Encoding Byte -Path $dst_x000D__x000A_</S><S S="Error"> -Value ([Convert]::FromBase64String &lt;&lt;&lt;&lt; ([IO.File]::ReadAllLines($src)))}_x000D__x000A_</S><S S="Error"> + CategoryInfo : NotSpecified: (:) [], MethodInvocationException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : DotNetMethodException_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S><S S="Error">Get-Item : Cannot find path 'C:\Users\vagrant\AppData\Local\Temp\tmpzip-3395dca_x000D__x000A_</S><S S="Error">1ace537199fc6ec84fb894f56.zip' because it does not exist._x000D__x000A_</S><S S="Error">At line:30 char:45_x000D__x000A_</S><S S="Error">+ $bytes = $c.ComputeHash(($in = (Get-Item &lt;&lt;&lt;&lt; $src).OpenRead()))_x000D__x000A_</S><S S="Error"> + CategoryInfo : ObjectNotFound: (C:\Users\vagran...c84fb894f56.z _x000D__x000A_</S><S S="Error"> ip:String) [Get-Item], ItemNotFoundException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetIt _x000D__x000A_</S><S S="Error"> emCommand_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S><S S="Error">The term 'Cleanup' is not recognized as the name of a cmdlet, function, script _x000D__x000A_</S><S S="Error">file, or operable program. Check the spelling of the name, or if a path was inc_x000D__x000A_</S><S S="Error">luded, verify that the path is correct and try again._x000D__x000A_</S><S S="Error">At line:32 char:50_x000D__x000A_</S><S S="Error">+ } catch [exception]{throw $_} finally { Cleanup &lt;&lt;&lt;&lt; $c; Cleanup $in }_x000D__x000A_</S><S S="Error"> + CategoryInfo : ObjectNotFound: (Cleanup:String) [], CommandNotF _x000D__x000A_</S><S S="Error"> oundException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : CommandNotFoundException_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S><S S="Error">The term 'Cleanup' is not recognized as the name of a cmdlet, function, script _x000D__x000A_</S><S S="Error">file, or operable program. Check the spelling of the name, or if a path was inc_x000D__x000A_</S><S S="Error">luded, verify that the path is correct and try again._x000D__x000A_</S><S S="Error">At line:32 char:62_x000D__x000A_</S><S S="Error">+ } catch [exception]{throw $_} finally { Cleanup $c; Cleanup &lt;&lt;&lt;&lt; $in }_x000D__x000A_</S><S S="Error"> + CategoryInfo : ObjectNotFound: (Cleanup:String) [], CommandNotF _x000D__x000A_</S><S S="Error"> oundException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : CommandNotFoundException_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S><S S="Error">You cannot call a method on a null-valued expression._x000D__x000A_</S><S S="Error">At line:30 char:60_x000D__x000A_</S><S S="Error">+ $bytes = $c.ComputeHash(($in = (Get-Item $src).OpenRead &lt;&lt;&lt;&lt; ()))_x000D__x000A_</S><S S="Error"> + CategoryInfo : InvalidOperation: (OpenRead:String) [], RuntimeE _x000D__x000A_</S><S S="Error"> xception_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : InvokeMethodOnNull_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S></Objs>
E, [2015-08-18T09:25:42.329124 #7010] ERROR -- Kitchen: ------Backtrace-------
E, [2015-08-18T09:25:42.329141 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/winrm-transport-1.0.1/lib/winrm/transport/file_transporter.rb:360:in `parse_response'
E, [2015-08-18T09:25:42.329159 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/winrm-transport-1.0.1/lib/winrm/transport/file_transporter.rb:260:in `decode_files'
E, [2015-08-18T09:25:42.329176 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/winrm-transport-1.0.1/lib/winrm/transport/file_transporter.rb:96:in `block in upload'
E, [2015-08-18T09:25:42.329203 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
E, [2015-08-18T09:25:42.329221 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/winrm-transport-1.0.1/lib/winrm/transport/file_transporter.rb:87:in `upload'
E, [2015-08-18T09:25:42.329252 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/transport/winrm.rb:118:in `upload'
E, [2015-08-18T09:25:42.329280 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/provisioner/base.rb:68:in `block in call'
E, [2015-08-18T09:25:42.329298 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/transport/winrm.rb:467:in `reuse_connection'
E, [2015-08-18T09:25:42.329315 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/transport/winrm.rb:60:in `connection'
E, [2015-08-18T09:25:42.329332 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/provisioner/base.rb:64:in `call'
E, [2015-08-18T09:25:42.329358 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:366:in `block in converge_action'
E, [2015-08-18T09:25:42.329376 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:488:in `call'
E, [2015-08-18T09:25:42.329394 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:488:in `synchronize_or_call'
E, [2015-08-18T09:25:42.329411 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:453:in `block in action'
E, [2015-08-18T09:25:42.329429 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
E, [2015-08-18T09:25:42.329446 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:452:in `action'
E, [2015-08-18T09:25:42.329463 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:362:in `converge_action'
E, [2015-08-18T09:25:42.329490 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:341:in `block in transition_to'
E, [2015-08-18T09:25:42.329510 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:340:in `each'
E, [2015-08-18T09:25:42.329538 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:340:in `transition_to'
E, [2015-08-18T09:25:42.329556 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:138:in `converge'
E, [2015-08-18T09:25:42.329573 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/command.rb:176:in `public_send'
E, [2015-08-18T09:25:42.329597 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/command.rb:176:in `block (2 levels) in run_action'
E, [2015-08-18T09:25:42.329653 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call'
E, [2015-08-18T09:25:42.329672 #7010] ERROR -- Kitchen: /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'
E, [2015-08-18T09:25:42.329708 #7010] ERROR -- Kitchen: ----------------------
---
timestamp: 2015-08-18 19:38:21 UTC
kitchen_version: 1.4.0
plugins:
driver:
Vagrant:
class: Kitchen::Driver::Vagrant
version: 0.18.0
api_version: 2
provisioner:
ChefSolo:
class: Kitchen::Provisioner::ChefSolo
version: 1.4.0
api_version: 2
transport:
Winrm:
class: Kitchen::Transport::Winrm
version: 1.4.0
api_version: 1
verifier:
Busser:
class: Kitchen::Verifier::Busser
version: 1.4.0
api_version: 1
loader:
process_erb: true
process_local: true
process_global: true
global_config:
project_config:
filename: "/home/user/Projects/my_cookbook/.kitchen.yml"
raw_data:
driver:
name: vagrant
forward_agent: true
communicator: winrm
guest: windows
provisioner:
name: chef_solo
password: vagrant
username: vagrant
transport:
name: winrm
platforms:
- name: windows-2008r2
driver_config:
vm_hostname: false
guest: windows
communicator: winrm
os_type: windows
shell_type: powershell
transport:
name: winrm
suites:
- name: default
run_list:
- recipe[my_cookbook::default]
attributes:
local_config:
combined_config:
filename:
raw_data:
driver:
name: vagrant
forward_agent: true
communicator: winrm
guest: windows
provisioner:
name: chef_solo
password: vagrant
username: vagrant
transport:
name: winrm
platforms:
- name: windows-2008r2
driver_config:
vm_hostname: false
guest: windows
communicator: winrm
os_type: windows
shell_type: powershell
transport:
name: winrm
suites:
- name: default
run_list:
- recipe[my_cookbook::default]
attributes:
instances:
default-windows-2008r2:
platform:
os_type: windows
shell_type: powershell
state_file:
hostname: 127.0.0.1
last_action: create
password: vagrant
port: '5985'
rdp_port: '3389'
username: vagrant
driver:
box: windows-2008r2
box_check_update:
box_url:
box_version:
communicator: winrm
customize: {}
forward_agent: true
guest: windows
gui:
kitchen_root: "/home/user/Projects/my_cookbook"
log_level: :info
name: vagrant
network: []
pre_create_command:
provider: virtualbox
provision: false
ssh: {}
synced_folders: []
test_base_path: "/home/user/Projects/my_cookbook/test/integration"
vagrantfile_erb: "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/kitchen-vagrant-0.18.0/templates/Vagrantfile.erb"
vagrantfiles: []
vm_hostname: false
provisioner:
attributes: {}
chef_metadata_url: https://www.chef.io/chef/metadata?p=windows&m=x86_64&pv=2008r2&v=latest
chef_omnibus_install_options:
chef_omnibus_root: "$env:systemdrive\\opscode\\chef"
chef_omnibus_url: https://www.chef.io/chef/install.sh
chef_solo_path: "$env:systemdrive\\opscode\\chef\\bin\\chef-solo.bat"
clients_path:
cookbook_files_glob: README.*,metadata.{json,rb},attributes/**/*,definitions/**/*,files/**/*,libraries/**/*,providers/**/*,recipes/**/*,resources/**/*,templates/**/*
data_bags_path:
data_path:
encrypted_data_bag_secret_key_path:
environments_path:
http_proxy:
https_proxy:
kitchen_root: "/home/user/Projects/my_cookbook"
log_file:
log_level: :info
name: chef_solo
nodes_path:
password: vagrant
require_chef_omnibus: true
roles_path:
root_path: "$env:TEMP\\kitchen"
run_list:
- recipe[my_cookbook::default]
solo_rb: {}
sudo:
sudo_command:
test_base_path: "/home/user/Projects/my_cookbook/test/integration"
username: vagrant
transport:
connection_retries: 5
connection_retry_sleep: 1
endpoint_template: http://%{hostname}:%{port}/wsman
kitchen_root: "/home/user/Projects/my_cookbook"
log_level: :info
max_wait_until_ready: 600
name: winrm
password:
port: 5985
rdp_port: 3389
test_base_path: "/home/user/Projects/my_cookbook/test/integration"
username: ".\\administrator"
verifier:
busser_bin: "$env:TEMP\\verifier\\bin\\busser.bat"
http_proxy:
https_proxy:
kitchen_root: "/home/user/Projects/my_cookbook"
log_level: :info
name: busser
root_path: "$env:TEMP\\verifier"
ruby_bindir: "$env:systemdrive\\opscode\\chef\\embedded\\bin"
sudo:
sudo_command:
suite_name: default
test_base_path: "/home/user/Projects/my_cookbook/test/integration"
version: busser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment