Cannot verify network traffic by "knife wsman test" command

i am following this link (https://learn.chef.io/manage-a-node/windows/get-a-node-to-bootstrap/) to bootstrap my windows server 2012. However, when I tried to run this command to verify the network traffic on port 5966, I got the following error message, anyone here can help me with this?

I am using the newest version of Chef and powershell.

PS C:\Users\Yuj\chef-repo> knife wsman test pilappintin02 --manual-list --winrm-transport ssl --winrm-ssl-verify-mode verify_none
FATAL: Cannot find subcommand for: 'wsman test pilappintin02 --manual-list --winrm-transport ssl --winrm-ssl-verify-mode verify_none’
Available subcommands: (for details, knife SUB-COMMAND --help)

** BOOTSTRAP COMMANDS **
knife bootstrap [SSH_USER@]FQDN (options)

** CLIENT COMMANDS **
knife client bulk delete REGEX (options)
knife client create CLIENTNAME (options)
knife client delete CLIENT (options)
knife client edit CLIENT (options)
Usage: C:/opscode/chef/modules/chef/…/…/bin/knife (options)
knife client key delete CLIENT KEYNAME (options)
knife client key edit CLIENT KEYNAME (options)
knife client key list CLIENT (options)
knife client key show CLIENT KEYNAME (options)
knife client list (options)
knife client reregister CLIENT (options)
knife client show CLIENT (options)

** CONFIGURE COMMANDS **
knife configure (options)
knife configure client DIRECTORY

** COOKBOOK COMMANDS **
knife cookbook bulk delete REGEX (options)
knife cookbook create COOKBOOK (options)
knife cookbook delete COOKBOOK VERSION (options)
knife cookbook download COOKBOOK [VERSION] (options)
knife cookbook list (options)
knife cookbook metadata COOKBOOK (options)
knife cookbook metadata from FILE (options)
knife cookbook show COOKBOOK [VERSION] [PART] [FILENAME] (options)
knife cookbook test [COOKBOOKS…] (options)
knife cookbook upload [COOKBOOKS…] (options)

** COOKBOOK SITE COMMANDS **
knife cookbook site download COOKBOOK [VERSION] (options)
knife cookbook site install COOKBOOK [VERSION] (options)
knife cookbook site list (options)
knife cookbook site search QUERY (options)
knife cookbook site share COOKBOOK [CATEGORY] (options)
knife cookbook site show COOKBOOK [VERSION] (options)
knife cookbook site unshare COOKBOOK

** DATA BAG COMMANDS **
knife data bag create BAG [ITEM] (options)
knife data bag delete BAG [ITEM] (options)
knife data bag edit BAG ITEM (options)
knife data bag from file BAG FILE|FOLDER [FILE|FOLDER…] (options)
knife data bag list (options)
knife data bag show BAG [ITEM] (options)

** ENVIRONMENT COMMANDS **
knife environment compare [ENVIRONMENT…] (options)
knife environment create ENVIRONMENT (options)
knife environment delete ENVIRONMENT (options)
knife environment edit ENVIRONMENT (options)
knife environment from file FILE [FILE…] (options)
knife environment list (options)
knife environment show ENVIRONMENT (options)

** EXEC COMMANDS **
knife exec [SCRIPT] (options)

** HELP COMMANDS **
knife help [list|TOPIC]

** INDEX COMMANDS **
knife index rebuild (options)

** KNIFE COMMANDS **
Usage: C:/opscode/chef/modules/chef/…/…/bin/knife (options)

** NODE COMMANDS **
knife node bulk delete REGEX (options)
knife node create NODE (options)
knife node delete NODE (options)
knife node edit NODE (options)
knife node environment set NODE ENVIRONMENT
knife node from file FILE (options)
knife node list (options)
knife node run_list add [NODE] [ENTRY[,ENTRY]] (options)
knife node run_list remove [NODE] [ENTRY[,ENTRY]] (options)
knife node run_list set NODE ENTRIES (options)
knife node show NODE (options)

** NULL COMMANDS **
knife null

** OSC COMMANDS **
knife osc_user create USER (options)
knife osc_user delete USER (options)
knife osc_user edit USER (options)
knife osc_user list (options)
knife osc_user reregister USER (options)
knife osc_user show USER (options)

** PATH-BASED COMMANDS **
knife delete [PATTERN1 … PATTERNn]
knife deps PATTERN1 [PATTERNn]
knife diff PATTERNS
knife download PATTERNS
knife edit [PATTERN1 … PATTERNn]
knife list [-dfR1p] [PATTERN1 … PATTERNn]
knife show [PATTERN1 … PATTERNn]
knife upload PATTERNS
knife xargs [COMMAND]

** RAW COMMANDS **
knife raw REQUEST_PATH

** RECIPE COMMANDS **

This output suggests that you do not have the knife-windows gem installed. Do you have the chef-dk installed or just the chef client? knife-windows comes with the chef-dk.

Thank you, I got it. Just installed the knife-window gem.

I will proceed with the command again next Monday when I am in office.

I still get error as below even with the “knife-windows gem” installed. could you please help me with this?

the bootstrap progress is really irritating and annoying! do you have any resource to introduce it systematically.

Thanks.

PS C:\Users\Yuj\chef-repo> test-wsman -computername chef_testnode1.na.kfy.com

wsmid : http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd
ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
ProductVendor : Microsoft Corporation
ProductVersion : OS: 0.0.0 SP: 0.0 Stack: 3.0

PS C:\Users\Yuj\chef-repo> knife wsman test chef_testnode1.na.kfy.com --manual-list --winrm-transport ssl
FATAL: Cannot find subcommand for: 'wsman test chef_testnode1.na.kfy.com --manual-list --winrm-transport ssl’
Available subcommands: (for details, knife SUB-COMMAND --help)

** BOOTSTRAP COMMANDS **
knife bootstrap [SSH_USER@]FQDN (options)

** CLIENT COMMANDS **
knife client bulk delete REGEX (options)
knife client create CLIENTNAME (options)
knife client delete CLIENT (options)
knife client edit CLIENT (options)
Usage: C:/opscode/chef/modules/chef/…/…/bin/knife (options)
knife client key delete CLIENT KEYNAME (options)
knife client key edit CLIENT KEYNAME (options)
knife client key list CLIENT (options)
knife client key show CLIENT KEYNAME (options)
knife client list (options)
knife client reregister CLIENT (options)
knife client show CLIENT (options)

** CONFIGURE COMMANDS **
knife configure (options)
knife configure client DIRECTORY

** COOKBOOK COMMANDS **
knife cookbook bulk delete REGEX (options)
knife cookbook create COOKBOOK (options)
knife cookbook delete COOKBOOK VERSION (options)
knife cookbook download COOKBOOK [VERSION] (options)
knife cookbook list (options)
knife cookbook metadata COOKBOOK (options)
knife cookbook metadata from FILE (options)
knife cookbook show COOKBOOK [VERSION] [PART] [FILENAME] (options)
knife cookbook test [COOKBOOKS…] (options)
knife cookbook upload [COOKBOOKS…] (options)

** COOKBOOK SITE COMMANDS **
knife cookbook site download COOKBOOK [VERSION] (options)
knife cookbook site install COOKBOOK [VERSION] (options)
knife cookbook site list (options)
knife cookbook site search QUERY (options)
knife cookbook site share COOKBOOK [CATEGORY] (options)
knife cookbook site show COOKBOOK [VERSION] (options)
knife cookbook site unshare COOKBOOK

** DATA BAG COMMANDS **

Install chef-dk… It solved mine.

One possibility may be that you have chef-dk but are hitting a bug from a previous chef-dk. The workaround was to delete ~/.chef/plugin_manifest.json. Give that a shot.

Hi, Matt, thanks for your reply. I uninstalled the old chef-DK version and installed the newest one downloaded from the website. I got the version information as below and I verified I upgrade it.

After upgrade chef-DK

PS C:\Users\Yuj\chef-repo> chef gem list rake

*** LOCAL GEMS ***

rake (11.1.2, default: 10.1.0)
PS C:\Users\Yuj\chef-repo> chef exec kitchen -v
Test Kitchen version 1.7.3
PS C:\Users\Yuj\chef-repo> chef -v
Chef Development Kit Version: 0.13.21
chef-client version: 12.9.41
berks version: 4.3.2
kitchen version: 1.7.3
PS C:\Users\Yuj\chef-repo>

However, when I try to run “knife wsman test” again, I still got the following error:

Please help, thanks.

PS C:\Users\Yuj\chef-repo> knife wsman test chef_testnode1.na.kfy.com --manual-list --winrm-transport ssl
ERROR: URI::InvalidURIError: the scheme https does not accept registry part: chef_testnode1.na.kfy.com:5986 (or bad hostname?)
PS C:\Users\Yuj\chef-repo>

I tried to run the same command with the IP address, also I changed the options for the command, it works partially.

do i need download a new certificate from the server? what’s wrong with it?

thanks.

PS C:\Users\Yuj\chef-repo> knife wsman test chef_testnode1.na.kfy.com --manual-list --winrm-transport ssl
ERROR: URI::InvalidURIError: the scheme https does not accept registry part: chef_testnode1.na.kfy.com:5986 (or bad hostname?)
PS C:\Users\Yuj\chef-repo> knife wsman test 172.16.20.67 --manual-list --winrm-transport ssl
WARNING: Failed to connect to 172.16.20.67 at https://172.16.20.67:5986/wsman.
WARNING: Failure due to an issue with SSL; likely cause would be unsuccesful certificate verification.
WARNING: Either ensure your certificate is valid or use ‘–winrm-ssl-verify-mode verify_none’ to ignore verification failures.
ERROR: Failed to connect to 1 nodes.
PS C:\Users\Yuj\chef-repo> knife wsman test 172.16.20.67 --manual-list --winrm-ssl-verify-mode verify_none
Connected successfully to 172.16.20.67 at http://172.16.20.67:5985/wsman.
PS C:\Users\Yuj\chef-repo>

It couldn't locate the machine via "chef_testnode1.na.kfy.com" hostname but able to get it via IP. Try to add it to the c:\Windows\System32\drivers\etc\hosts file like below and give it a try.

172.16.20.67 chef_testnode1.na.kfy.com