I\'m trying to run a django-server in a Vagrant box using Chef, but I\'ve been stuck on this for a few hours and can\'t find anything online. The relevant bit of my vagrantf
for me the solution was to make sure every cookbook I was using had a "name" attribute in it with the name of the cookbook. 'redis', 'install_from', and 'metachef' cookbooks were all missing the name field from the metadata.rb
chef-client v12.3.0 helped uncover this, 12.4.1 was not showing me anything useful
I've gotten this same error in Test Kitchen as well, though, not caused by the bug. The error message is exceptionally cryptic for the general case of a cookbook constraint not being met (i.e. a cookbook name or version that can't be found). In my case, from .kitchen.yml, I included an environment with specific cookbook version constraints, then specified conflicting version constraints in a Berksfile. That was dumb, so don't do that!
The error for me was related to two custom cookbooks that someone how had the same name in metadata.rb correcting it fixed it.
It happens if you try to use include_attribute 'foo'
in metadata.rb instead of attributes file.
Got this due to omitting the name
from a cookbook's metadata.rb
. Adding the name
fixed it.
The message we're seeing is clearly a bug in Chef and hopefully will get fixed soon, but in the meantime perhaps this can help anybody who made the same mistake as me.
Finally got it. As pointed out in the comments this problem is introduced in chef v. 12.4.0, I added the line chef.version = "12.3.0"
to the provision block and now it's working.