1

I'm trying to add a recipe to an existing cookbook (currently at version 0.14.1). I've created the file, incremented the cookbook version (0.15.0) and uploaded to my chef server.

I've verified there are no environment constraints that would prevent my node from receiving this update.

environments/production.rb

name "production"
description "Production environment for servers"
cookbook_versions({
    ...
    "mycookbook" => "~> 0.8",
    ...
})

And added the new recipe to the runlist of this node.

By all accounts, this should work for me. but for some reason - my nodes will not download the updated version. when I run chef-client

when I look at the metadata.json for the file /var/chef/cache/cookbook/mycookbook/metadata.json

{
  ...
  "version": "0.14.1",
  ...
}

it will never go past the 0.14.1 version.

I tried moving the cookbook folder out of the way and re-ran the chef-client, it re-downloaded all cookbooks, but still downloaded the old 0.14.1 version of the cookbook in question

I've double checked that the versions I've updated do exist on the chef-server, I've even tried showing the new cookbook recipe at the existing version and it returns what I expect

knife cookbook show mycookbook 0.15.0 recipes newrecipe.rb

--Update--

I was able to track down the problem to a random constraing in my environment file on a different cookbook that was holding back the updated version from being downloaded. once I relaxed this version constraint everything worked as I expected.

veilig
  • 5,085
  • 10
  • 48
  • 86
  • Has the new version any dependencies that are not fulfilled? – StephenKing Oct 14 '15 at 06:55
  • Once again a divination case... I can't guess your node run-list, if there's roles on the runlist or not, if the node is really in production environment nor most of things which would help. A head log of `chef-client -l debug` would help by showing the full runlist. **If the client can't get the new version, there's a constraint somewhere in the runlist preventing it.** Try fixing the version on your env and see what broke at this time if you can't find it from another way. – Tensibai Oct 14 '15 at 12:36
  • Voting to close, I don't see how this question could be helpful to someone else in the future. But I may be wrong. – Tensibai Oct 14 '15 at 14:26

0 Answers0