undefined method “cheffish” for nil:NilClass, when provisioning chef with vagrant

前端 未结 7 1793
故里飘歌
故里飘歌 2021-01-02 06:46

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

相关标签:
7条回答
  • 2021-01-02 07:13

    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

    0 讨论(0)
  • 2021-01-02 07:14

    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!

    0 讨论(0)
  • 2021-01-02 07:16

    The error for me was related to two custom cookbooks that someone how had the same name in metadata.rb correcting it fixed it.

    0 讨论(0)
  • 2021-01-02 07:19

    It happens if you try to use include_attribute 'foo' in metadata.rb instead of attributes file.

    0 讨论(0)
  • 2021-01-02 07:19

    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.

    0 讨论(0)
  • 2021-01-02 07:23

    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.

    0 讨论(0)
提交回复
热议问题