hi,
i'm investigating an weird problem. our recipe works well, most of time.
say, you have a base recipe with some basic attributes. other recipe
include_attribute the recipe and create new default attributes.
in common/attributes/default.rb
case node[:platform]
when "freebsd"
default.common[:etc_dir] = "/usr/local/etc"
else
default.common[:etc_dir] = "/etc"
end
in other_recipe/attributes/default.rb
include_attributes "common"
default.other_recipe[:config_dir] = "#{node[:common][:etc_dir]}/myconfig_dir"
this works as expected, most of time. the problem is, it fails
sometimes on different nodes. when it failed, failed-run-data.json
contains something like:
...
"default": {
"other_recipe": {
"config_fir": "/myconfig_dir",
...
}
}
...
this means node[:common][:etc_dir] is empty. interestingly,
node[:common][:etc_dir] is defined properly in failed-run-data.json;
it is "/usr/local/etc".
when it failed, I usually ssh to the node, run chef-client manually
and it succeeds.
this is very hard to reproduce as it happens randomly on some
nodes. at least, when you restart chef-client daemon, everything
is okay for a while. if you don't restart it, chef-run keeps
failing.
does anyone know where to look at?
--
Tomoyuki Sakurai
Archive powered by MHonArc 2.6.16.