chef-infracookbookchef-workstation

cannot run my cookbook on chef workstation


while running chef-client --local-mode --override-runlist first_cookbook I am getting following error

[2020-04-07T16:31:06+05:30] WARN: No config file found or specified on command line. Using command line options instead.
[2020-04-07T16:31:06+05:30] WARN: No cookbooks directory found at or above current directory.  Assuming C:/Windows/System32.
Starting Chef Infra Client, version 15.8.23

[2020-04-07T16:31:24+05:30] WARN: Run List override has been provided.
[2020-04-07T16:31:24+05:30] WARN: Original Run List: []
[2020-04-07T16:31:24+05:30] WARN: Overridden Run List: [recipe[first_cookbook]]
resolving cookbooks for run list: ["first_cookbook"]

================================================================================
Error Resolving Cookbooks for Run List:
================================================================================

Missing Cookbooks:
------------------
No such cookbook: first_cookbook

Expanded Run List:
------------------
* first_cookbook

System Info:
------------
chef_version=15.8.23
platform=windows
platform_version=10.0.18363
ruby=ruby 2.6.5p114 (2019-10-01 revision 67812) [x64-mingw32]
program_name=C:/opscode/chef-workstation/modules/chef/../../bin/chef-client
executable=C:/opscode/chef-workstation/bin/chef-client


Running handlers:

[2020-04-07T16:31:24+05:30] ERROR: Running exception handlers
Running handlers complete
[2020-04-07T16:31:24+05:30] ERROR: Exception handlers complete
Chef Infra Client failed. 0 resources updated in 18 seconds
[2020-04-07T16:31:24+05:30] FATAL: Stacktrace dumped to C:/Users/sneha/.chef/local-mode-cache/cache/chef-stacktrace.out
[2020-04-07T16:31:24+05:30] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report

[2020-04-07T16:31:24+05:30] FATAL: Net::HTTPServerException: 412 "Precondition Failed"

My path for cookbook is C:\Windows\System32\first_cookbook can someone help me with this I am new to chef and working windows OS is also new environment for me


Solution

  • After a lot of analysis I got to know it was a very small issue that our cookbooks (in my case first_cookbook) should be inside folder named as cookbooks