I want to provision a win2016 instance on aws with software packets and configuration and it already works for most chef functions (like downloading packets, setting env vars etc.). But when i try to search another node I run into a http exception, with a very non descriptive stacktrace.
To exclude any other factors I've excluded all other code pieces from being executed
my recipe:
my kitchen.yml:
driver:
name: ec2
aws_ssh_key_id: fake_id
security_group_ids: ["sg-fake","sg-fake"]
region: fake
vpc_id: vpc-fake
instance_initiated_shutdown_behavior: terminate
shared_credentials_profile: fake
subnet_id: subnet-fake
instance_type: t3.xlarge
associate_public_ip: false
interface: private
http_proxy: http:\fake
retryable_sleep: 8
retryable_tries: 200
transport:
ssh_key: fake
username: Administrator
ssh_gateway: fake
ssh_gateway_username: fake
connection_timeout: 10
connection_retries: 5
name: winrm
elevated: true
port: 5985
provisioner:
name: chef_zero
http_proxy: ""
https_proxy: ""
no_proxy: ""
install_msi_url: https:\fake
client_rb:
rubygems_url: https:\fake
node_name: kitchen.fake.cloud
log_location: "C:\chef\chef-client.log"
platforms:
- name: windows-2016
driver:
image_search:
name: Windows_Server-2016-English-Full-Base-20??.??.??
virtualization-type: "hvm"
owner-id: "801119661308"
block_device_mappings:
- device_name: /dev/xvda
ebs:
volume_size: 10
delete_on_termination: true
verifier:
name: inspec
suites:
- name: default
data_bags_path: test/fixtures/data_bags
nodes_path: test/fixtures/nodes
verifier:
inspec_tests:
- test/smoke/default
run_list:
- fake-windows-base
- fake-windows-taskserver
attributes:
fake-windows-taskserver:
target_db: "fake"
chef_vault:
databags_fallback: true
driver:
tags:
Name: <%= Time.now.strftime("%Y/%m/%d %H:%M") %>-<%= ENV['USER'] %>-fake-windows-taskserver
Project: infra
NWU: HO
Kitchen_Creator: <%= ENV['USER'] %>
Kitchen_Project: fake-windows-taskserver
my fake Node:
{
"name": "fake",
"chef_environment": "_default",
"normal": {
"tags": [
],
"fake-oracle-db": {
"data_base_name": "fake",
"port": "1521"
}
},
"default": {
"fake-oracle-db": {
"data_base_name": "fake",
"port": "1521"
}
},
"recipes": [
"fake-windows-base",
"fake-windows-base::default",
"fake-oracle-db",
"fake-oracle-db::default"
],
"run_list": [
"recipe[fake-windows-base]",
"recipe[fake-oracle-db]"
]
}
and finally, my stacktrace:
================================================================================
Recipe Compile Error in C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/fake-windows-taskserver/recipes/default.rb
================================================================================
Net::HTTPServerException
------------------------
404 "Not Found"
System Info:
------------
chef_version=14.1.1
platform=windows
platform_version=10.0.14393
ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]
program_name=C:/opscode/chef/bin/chef-client
executable=C:/opscode/chef/bin/chef-client
Running handlers:
[2020-02-27T10:39:35+00:00] ERROR: Running exception handlers
Running handlers complete
[2020-02-27T10:39:35+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 05 seconds
[2020-02-27T10:39:35+00:00] FATAL: Stacktrace dumped to C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/chef-stacktrace.out
[2020-02-27T10:39:35+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2020-02-27T10:39:35+00:00] FATAL: Net::HTTPServerException: 404 "Not Found"
D [WinRM] cleaning up command_id: 1E702105-9F0C-462D-A5F5-D09BEDACFFCC on shell_id 0691D9FD-342E-4FFB-AE2A-033111EF090C
D Cleaning up local sandbox in /tmp/default-windows-2016-sandbox-20200227-3479-zcsrj3
------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Converge failed on instance . Please see .kitchen/logs/default-windows-2016.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 . Please see .kitchen/logs/default-windows-2016.log for more details
D ----------------------
D ------Backtrace-------
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:183:in report_errors' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:174:in
run_action'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command/action.rb:36:in block in call' D /opt/chefdk/embedded/lib/ruby/2.5.0/benchmark.rb:293:in
measure'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command/action.rb:34:in call' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/cli.rb:52:in
perform'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/cli.rb:193:in block (2 levels) in <class:CLI>' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in
run'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in
dispatch'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in start' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/bin/kitchen:13:in
block in <top (required)>'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/errors.rb:171:in with_friendly_errors' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/bin/kitchen:13:in
<top (required)>'
D /usr/bin/kitchen:306:in load' D /usr/bin/kitchen:306:in
'
D ----End Backtrace-----
D -Composite Exception--
D Class: Kitchen::InstanceFailure
D Message: Converge failed on instance . Please see .kitchen/logs/default-windows-2016.log for more details
D ----------------------
D ------Backtrace-------
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/provisioner/base.rb:95:in rescue in call' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/provisioner/base.rb:71:in
call'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:408:in block in converge_action' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:551:in
synchronize_or_call'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:513:in block in action' D /opt/chefdk/embedded/lib/ruby/2.5.0/benchmark.rb:293:in
measure'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:512:in action' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:404:in
converge_action'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:382:in block (2 levels) in transition_to' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/lifecycle_hooks.rb:45:in
run_with_hooks'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:381:in block in transition_to' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:380:in
each'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:380:in transition_to' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:140:in
converge'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:197:in public_send' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:197:in
run_action_in_thread'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:169:in block (2 levels) in run_action' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in
block in create_with_logging_context'
D ----End Backtrace-----
D ---Nested Exception---
D Class: Kitchen::ActionFailed
D Message: WinRM exited (1) for command: [$env:TEST_KITCHEN = "1"
$env:PATH = try {
[System.Environment]::GetEnvironmentVariable('PATH','Machine')
} catch { $env:PATH }
& $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 /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/provisioner/base.rb:95:in rescue in call' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/provisioner/base.rb:71:in
call'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:408:in block in converge_action' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:551:in
synchronize_or_call'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:513:in block in action' D /opt/chefdk/embedded/lib/ruby/2.5.0/benchmark.rb:293:in
measure'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:512:in action' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:404:in
converge_action'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:382:in block (2 levels) in transition_to' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/lifecycle_hooks.rb:45:in
run_with_hooks'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:381:in block in transition_to' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:380:in
each'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:380:in transition_to' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/instance.rb:140:in
converge'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:197:in public_send' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:197:in
run_action_in_thread'
D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.24.0/lib/kitchen/command.rb:169:in block (2 levels) in run_action' D /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in
block in create_with_logging_context'
D ----End Backtrace-----
Am I missing something, because I really can't figure out where the error is coming from
How is your fake node added to the kitchen env, and where? Off the top of my head, chef_zero (in kitchen) looks for them in /tmp/kitchen/nodes
edit I think I see it: you set your fake node in client.rb, which tells the kitchen node it's the fake one. To test search you'll need your fake node to exist in the folder I mentioned, and the kitchen node should not name it anywhere in it's own conf
hey, thanks for answering. I actually found the reason for this problem yesterday, one of my nodes had a fqdn like cloud.rbg.com and chef-zero actually cuts away all ".rb" of a name because of a faulty regex. It should be fixed in the next version.
1 Like