{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef-dk/issues/379","labels_url":"https://api.github.com/repos/chef/chef-dk/issues/379/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef-dk/issues/379/comments","events_url":"https://api.github.com/repos/chef/chef-dk/issues/379/events","html_url":"https://github.com/chef/chef-dk/issues/379","id":73415998,"number":379,"title":"knife encountered an unexpected error","user":{"login":"spuder","id":242382,"avatar_url":"https://avatars.githubusercontent.com/u/242382?v=3","gravatar_id":"","url":"https://api.github.com/users/spuder","html_url":"https://github.com/spuder","followers_url":"https://api.github.com/users/spuder/followers","following_url":"https://api.github.com/users/spuder/following{/other_user}","gists_url":"https://api.github.com/users/spuder/gists{/gist_id}","starred_url":"https://api.github.com/users/spuder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spuder/subscriptions","organizations_url":"https://api.github.com/users/spuder/orgs","repos_url":"https://api.github.com/users/spuder/repos","events_url":"https://api.github.com/users/spuder/events{/privacy}","received_events_url":"https://api.github.com/users/spuder/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-05T19:58:36Z","updated_at":"2015-05-07T19:19:55Z","closed_at":"2015-05-07T19:19:55Z","body":"Trying to run knife on windows server 2012r2 throws an unexpected error\r\n\r\n```\r\nPS C:\\Users\\sowen\\.chefdk\\gem\\ruby\\2.1.0\\gems> chef --version\r\nChef Development Kit Version: 0.5.1\r\n```\r\n\r\n```powershell\r\nPS C:\\Windows\\system32>  knife bootstrap windows winrm $IPAddresses -N $GUESTNAME -x $USER -P $PASSWORD -VV\r\nINFO: Using configuration from C:/Users/sowen/.chef/knife.rb\r\n\r\nWaiting for remote response before bootstrap.DEBUG: Adding 10.254.130.129\r\nDEBUG: :session => :init\r\nDEBUG: :relay_to_servers => echo . & echo Response received.\r\nDEBUG: :relayed => 10.254.130.129\r\nDEBUG: 10.254.130.129 => :run_command\r\nDEBUG: 10.254.130.129[D14F16FA-51C8-4B0F-BE42-9A9899A7CB79] => :shell_open\r\nDEBUG: 10.254.130.129[D14F16FA-51C8-4B0F-BE42-9A9899A7CB79] => :run_command[echo . & echo Response received.]\r\nDEBUG: :relay_output_from_backend => [\"10.254.130.129\", \". \\r\\n\"]\r\n10.254.130.129 .\r\nDEBUG: :relay_output_from_backend => [\"10.254.130.129\", \"Response received.\\r\\n\"]\r\n10.254.130.129 Response received.\r\nDEBUG: 10.254.130.129[D14F16FA-51C8-4B0F-BE42-9A9899A7CB79] => :command_cleanup[echo . & echo Response received.]\r\nDEBUG: 10.254.130.129[D14F16FA-51C8-4B0F-BE42-9A9899A7CB79] => :shell_close\r\nDEBUG: :command_complete => 10.254.130.129 with return code 0\r\nDEBUG: command complete on 10.254.130.129\r\nDEBUG: command complete on All Servers\r\nDEBUG: Exit code found: 0\r\nDEBUG: :unbind => :connection\r\nDEBUG: 10.254.130.129 => :unbind\r\nDEBUG: :unbind_backend => 10.254.130.129\r\nDEBUG: :session => :close\r\nRemote node responded after 0.32 minutes.\r\nBootstrapping Chef on 10.254.130.129\r\nDEBUG: Looking for bootstrap template in C:/Users/sowen/.chefdk/gem/ruby/2.1.0/gems/knife-windows-0.8.4/lib/chef/knife/bootstrap\r\nDEBUG: Found bootstrap template in C:/Users/sowen/.chefdk/gem/ruby/2.1.0/gems/knife-windows-0.8.4/lib/chef/knife/bootstrap\r\nERROR: knife encountered an unexpected error\r\nThis may be a bug in the 'bootstrap windows winrm' knife command or plugin\r\nPlease collect the output of this command with the `-VV` option before filing a bug report.\r\nException: NoMethodError: undefined method `gsub' for false:FalseClass\r\nPS C:\\Windows\\system32>                                                                                                                          \r\n```\r\n\r\nI have the following gems installed ( `chef gem install knife-windows`)\r\n\r\n```\r\nPS C:\\Users\\sowen\\.chefdk\\gem\\ruby\\2.1.0\\gems> ls\r\n\r\n\r\n    Directory: C:\\Users\\sowen\\.chefdk\\gem\\ruby\\2.1.0\\gems\r\n\r\n\r\nMode                LastWriteTime     Length Name\r\n----                -------------     ------ ----\r\nd----          5/5/2015   1:24 PM            knife-windows-0.8.4\r\nd----          5/4/2015   4:06 PM            pkg-config-1.1.6\r\nd----          5/4/2015   4:06 PM            ruby-wmctrl-0.0.6\r\nd----          5/5/2015   1:38 PM            winrm-1.3.3\r\n\r\n```\r\n\r\nAs a work around, I've double checked that the bundled ruby is the one in use. \r\n\r\n     chef shell-init powershell | Invoke-Expression\r\n\r\nI can reproduce this. Here is the output from another machine in the same network that crashes with the same error. \r\n\r\nhttp://pastebin.com/bQabnWY5\r\n\r\n                                                                                                                              "},"comment":{"url":"https://api.github.com/repos/chef/chef-dk/issues/comments/99987354","html_url":"https://github.com/chef/chef-dk/issues/379#issuecomment-99987354","issue_url":"https://api.github.com/repos/chef/chef-dk/issues/379","id":99987354,"user":{"login":"spuder","id":242382,"avatar_url":"https://avatars.githubusercontent.com/u/242382?v=3","gravatar_id":"","url":"https://api.github.com/users/spuder","html_url":"https://github.com/spuder","followers_url":"https://api.github.com/users/spuder/followers","following_url":"https://api.github.com/users/spuder/following{/other_user}","gists_url":"https://api.github.com/users/spuder/gists{/gist_id}","starred_url":"https://api.github.com/users/spuder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spuder/subscriptions","organizations_url":"https://api.github.com/users/spuder/orgs","repos_url":"https://api.github.com/users/spuder/repos","events_url":"https://api.github.com/users/spuder/events{/privacy}","received_events_url":"https://api.github.com/users/spuder/received_events","type":"User","site_admin":false},"created_at":"2015-05-07T19:19:55Z","updated_at":"2015-05-07T19:19:55Z","body":"This was caused because I did not have the validation.pem file in the `~/.chef` directory.  "}}