Cookbook version
1.0.0
Chef-client version
13.0.118
Platform Details
I'm using Vagrant 1.9.3 on OS X (10.11.6) to provision the default Hashicorp ubuntu/trusty64
box.
System info outputted by Chef when provisioning fails:
==> default: System Info:
==> default: ------------
==> default: chef_version=13.0.118
==> default: platform=ubuntu
==> default: platform_version=14.04
==> default: ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
==> default: program_name=chef-solo worker: ppid=1461;start=04:05:03;
==> default: executable=/opt/chef/bin/chef-solo
Scenario:
I'm trying to use Vagrant and Chef to auto-provision a VM for developing an Elixir project.
However, when I try to provision the VM, Chef fails:
NoMethodError: ruby_block[attribute-validation for 'elixir' (convergence time)] (elixir::default line 40) had an error: NoMethodError: undefined method `root_filenames' for #<Chef::CookbookVersion:0x00000002a90fe0>
See below for more debug information.
Steps to Reproduce:
I have a custom cookbook for my project with depends 'elixir'
in <mycookbook>/metadata.rb
and include_recipe 'elixir'
in <mycookbook>/recipes/default.rb
.
Note: A nearly identical cookbook was working successfully a few weeks ago, and I don't think I changed anything significant on my end.
I suspect this may be some sort of versioning problem. If it's obvious, I apologize, I'm new to both Vagrant and Chef.
Expected Result:
I expect the Elixir Chef cookbook to run successfully and have elixir
, mix
, and related tools installed on the Vagrant VM after provisioning.
Actual Result:
When I run vagrant up
(the first time) or vagrant reload --provision
I see the following error:
==> default: NoMethodError
==> default:
==> default: -------------
==> default:
==> default: undefined method `root_filenames' for #<Chef::CookbookVersion:0x0000000309f918>
==> default:
==> default:
==> default: Cookbook Trace:
==> default: ---------------
==> default: /var/chef/cache/cookbooks/validation/definitions/validate_attributes.rb:42:in `block (3 levels) in from_file'
==> default:
==> default: Resource Declaration:
==> default: ---------------------
==> default: # In /var/chef/cache/cookbooks/validation/definitions/validate_attributes.rb
==> default:
==> default: 40: ruby_block "attribute-validation for '#{cookbook}' (convergence time)" do
==> default: 41: block do
==> default: 42: errors = Chef::Validation.validate(node, cookbook)
==> default: 43: unless errors.empty?
==> default: 44: formatted = Chef::Validation::Formatter.format_errors(errors)
==> default: 45: Chef::Application.fatal!(formatted)
==> default: 46: end
==> default: 47: end
==> default: 48: end
==> default:
==> default: Compiled Resource:
==> default: ------------------
==> default: # Declared in /var/chef/cache/cookbooks/validation/definitions/validate_attributes.rb:40:in `block in from_file'
==> default:
==> default: ruby_block("attribute-validation for 'elixir' (convergence time)") do
==> default: params {:mode=>:converge, :cookbook=>nil, :name=>"elixir"}
==> default: action [:run]
==> default: default_guard_interpreter :default
==> default: block_name "attribute-validation for 'elixir' (convergence time)"
==> default: declared_type :ruby_block
==> default:
==> default: cookbook_name "elixir"
==> default:
==> default:
==> default: recipe_name "default"
==> default:
==> default:
==> default: block #<Proc:0x000000046c3690@/var/chef/cache/cookbooks/validation/definitions/validate_attributes.rb:41>
==> default:
==> default: end
And in /var/chef/cache/chef-stacktrace.out
in the VM:
NoMethodError: ruby_block[attribute-validation for 'elixir' (convergence time)] (elixir::default line 40) had an error: NoMethodError: undefined method `root_filenames' for #<Chef::CookbookVersion:0x0000000309f918>
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-validation-0.2.3/lib/chef/validation.rb:45:in `reload_metadata'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-validation-0.2.3/lib/chef/validation.rb:65:in `validate_one'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-validation-0.2.3/lib/chef/validation.rb:37:in `validate'
/var/chef/cache/cookbooks/validation/definitions/validate_attributes.rb:42:in `block (3 levels) in from_file'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.0.118/lib/chef/provider/ruby_block.rb:31:in `block in action_run'
...
>>>> Caused by NoMethodError: undefined method `root_filenames' for #<Chef::CookbookVersion:0x0000000309f918>
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-validation-0.2.3/lib/chef/validation.rb:45:in `reload_metadata'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-validation-0.2.3/lib/chef/validation.rb:65:in `validate_one'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-validation-0.2.3/lib/chef/validation.rb:37:in `validate'
/var/chef/cache/cookbooks/validation/definitions/validate_attributes.rb:42:in `block (3 levels) in from_file'
Thank you very much in advance for your time!