Test Kitchen Returns [no implicit conversion of nil into String]

Good Morning,

I am attempting to run through the Chef Learning tracks and stuck at creating an AWS EC2 Windows instance with Test Kitchen. The error received is below and Kitchen fails at this exact same spot every time. Debug log files are available if needed. Appreciate anyone's thoughts on that matter and thank you so much!!

2018/02/20 12:42:16Z: Message: Windows is Ready to use

   Waited 0/600s for instance <i-0a8ff8aaef2652770> to fetch windows admin password.

------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Failed to complete #create action: [no implicit conversion of nil into String] on default-windows-2012r2

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

System Setup
Windows 10 (16299.248)
Chef Development Kit Version: 2.4.17
chef-client version: 13.6.4
delivery version: master (73ebb72a6c42b3d2ff5370c476be800fee7e5427)
berks version: 6.3.1
kitchen version: 1.19.2
inspec version: 1.45.13
Python: 3.6.4
PIP: 9.0.1

A gist of the .kitchen.yml you have, the debug logs, and a link to the specific page/module you are on would be great. Even better come join us Chef Community Slack in the #test-kitchen channel and we can try to troubleshoot this in realtime.

Cheers,

When I’ve run into this it was because I hadn’t configured my aws ssh key that allows me to pull the Windows password. This goes under transport and adding that as well as increasing the retries usually fixes it for me.

1 Like

@cheeseplus, the information requested is below! Let me know if any issues accessing the GIST URL and thank you very much.

@dragon788, I created a new AWS Key Pair and generated a new Access Key ID for the IAM User and set those up accordingly on the Chef Workstation but still no go. Also attempted to increase the SSH Connection Retries as well. Thank you very much too!

Gist of Kitchen.yml, Kitchen Logs, and PS Kitchen Output: https://gist.github.com/sethro2/6071eb81735d1f5f32366e7595f14c55
Chef Training Module (Step 3): https://learn.chef.io/modules/local-development/windows/aws/apply-a-cookbook#/

Looks like the transport section is not properly aligned and since YAML takes it’s spacing/tabbing very seriously it’s not happy. Below I’ve fixed the alignment so you can see:

---
...
provisioner:
  name: chef_zero
  log_level: debug

verifier:
  name: inspec

transport:
  ssh_key: c:\users\admin\.aws\us-east.pem

platforms:
  - name: windows-2012r2

Removing the spaces from the beginning of the Transport line did the trick… unbelievable.

Thank you so much for helping a grasshopper find his way!!