We are using test kitchen to test our chef cookbooks.
On running chef-client inside the kitchen container, I am seeing this error:
[2020-03-21T07:22:21+00:00] WARN: *****************************************
[2020-03-21T07:22:21+00:00] WARN: Did not find config file: /etc/chef/client.rb, using command line options.
[2020-03-21T07:22:21+00:00] WARN: *****************************************
Starting Chef Client, version 14.2.0
Running handlers:
[2020-03-21T07:22:23+00:00] ERROR: Running exception handlers
Running handlers complete
[2020-03-21T07:22:23+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 01 seconds
[2020-03-21T07:22:23+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2020-03-21T07:22:23+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2020-03-21T07:22:23+00:00] FATAL: Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/chef/chef_guid
I have already run
$ kitchen create
$ kitchen converge
on the host.
On the kitchen VM, the directory /etc/chef doesn't exist.
[root@kitchen-test ~]# ls /etc/chef
ls: cannot access /etc/chef: No such file or directory
I am trying to run chef-client in trace log level mode as kitchen converge doesn't have trace logging. kitchen converge only supports debug level.
Versions:
Test Kitchen version 2.3.3 (on host) with dokken driver
Chef: 14.2.0 (in kitchen vm)
I have a hacky way to run chef-client in trace mode on the kitchen client node.
While kitchen converge is running, backup the files in /opt/kitchen somewhere safe. I chose /tmp
Kill kitchen converge by doing ^C or let it complete.
The structure of /opt/kitchen should look something like:
Now run chef-zero
Upload everything to chef-zero server
Now run chef-client in trace mode