You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cat recipes/default.rb
a = search(:node, "*:*")
b = data_bag_item("zero", "fluff")
file "/tmp/zerofiles" do
content a[0].to_s
end
file "/tmp/fluff" do
content b.to_s
end
But when I run chef-client -z -o zero I get the following error:
[2014-08-01T22:11:35-04:00] WARN: No config file found or specified on command line, using command line options.
Starting Chef Client, version 11.14.0.rc.2
[2014-08-01T22:11:36-04:00] WARN: Run List override has been provided.
[2014-08-01T22:11:36-04:00] WARN: Original Run List: []
[2014-08-01T22:11:36-04:00] WARN: Overridden Run List: [recipe[zero]]
resolving cookbooks for run list: ["zero"]
Synchronizing Cookbooks:
- zero
Compiling Cookbooks...
[2014-08-01T22:11:36-04:00] ERROR: Failed to load data bag item: "zero" "fluff"
================================================================================
Recipe Compile Error in /home/user/.chef/local-mode-cache/cache/cookbooks/zero/recipes/default.rb
================================================================================
Net::HTTPServerException
------------------------
404 "Not Found "
Cookbook Trace:
---------------
/home/user/.chef/local-mode-cache/cache/cookbooks/zero/recipes/default.rb:2:in `from_file'
Relevant File Content:
----------------------
/home/user/.chef/local-mode-cache/cache/cookbooks/zero/recipes/default.rb:
1: a = search(:node, "*:*")
2>> b = data_bag_item("zero", "fluff")
3:
4: file "/tmp/zerofiles" do
5: content a[0].to_s
6: end
7:
8: file "/tmp/fluff" do
9: content b.to_s
10: end
11:
Running handlers:
[2014-08-01T22:11:36-04:00] ERROR: Running exception handlers
Running handlers complete
[2014-08-01T22:11:36-04:00] ERROR: Exception handlers complete
[2014-08-01T22:11:36-04:00] FATAL: Stacktrace dumped to /home/user/.chef/local-mode-cache/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 1.607884477 seconds
[2014-08-01T22:11:36-04:00] ERROR: 404 "Not Found "
[2014-08-01T22:11:36-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
I took a look at my chef-zero cache, and as a matter of fact, the data_bags folder was not copied over.
ok I figured this out a while ago, but forgot to update the issue.. the databags need to be brought up to the chef-zero root level
Here's what my working folder structure looks like
Basically as part of my script that extracts my cookbooks into the /var/chef/cookbooks folder, I copy the necessary databags into a data_bags folder thats a sibling the cookbooks folder.
Everything works as normal after that.
This looks pretty similar to #56 , except my files are named correctly.
I have the following folder structure
And my default recipe looks like:
But when I run
chef-client -z -o zero
I get the following error:I took a look at my chef-zero cache, and as a matter of fact, the data_bags folder was not copied over.
Am I missing something? Is there additional configuration required to tell chef-zero to copy over the data-bags?
The text was updated successfully, but these errors were encountered: