2

Here's the output of vagrant up (after a vagrant destroy) of the box in question (vagrant provision results in the same error):

==> mongos-zend: ================================================================================
==> mongos-zend: Recipe Compile Error in /var/chef/cache/cookbooks/mysql/libraries/provider_mysql_service_debian.rb
==> mongos-zend: ================================================================================
==> mongos-zend: 
==> mongos-zend: 
==> mongos-zend: NameError
==> mongos-zend: ---------
==> mongos-zend: uninitialized constant Opscode::Mysql
==> mongos-zend: 
==> mongos-zend: 
==> mongos-zend: Cookbook Trace:
==> mongos-zend: ---------------
==> mongos-zend:   /var/chef/cache/cookbooks/mysql/libraries/provider_mysql_service_debian.rb:17:in `<class:Debian>'
==> mongos-zend:   /var/chef/cache/cookbooks/mysql/libraries/provider_mysql_service_debian.rb:9:in `<class:MysqlService>'
==> mongos-zend:   /var/chef/cache/cookbooks/mysql/libraries/provider_mysql_service_debian.rb:8:in `<class:Provider>'
==> mongos-zend:   /var/chef/cache/cookbooks/mysql/libraries/provider_mysql_service_debian.rb:7:in `<class:Chef>'
==> mongos-zend:   /var/chef/cache/cookbooks/mysql/libraries/provider_mysql_service_debian.rb:6:in `<top (required)>'
==> mongos-zend: 
==> mongos-zend: 
==> mongos-zend: Relevant File Content:
==> mongos-zend: ----------------------
==> mongos-zend: /var/chef/cache/cookbooks/mysql/libraries/provider_mysql_service_debian.rb:
==> mongos-zend: 
==> mongos-zend:  10:          use_inline_resources if defined?(use_inline_resources)
==> mongos-zend:  11:  
==> mongos-zend:  12:          def whyrun_supported?
==> mongos-zend:  13:            true
==> mongos-zend:  14:          end
==> mongos-zend:  15:  
==> mongos-zend:  16:          include MysqlCookbook::Helpers::Debian
==> mongos-zend:  17>>         include Opscode::Mysql::Helpers
==> mongos-zend:  18:  
==> mongos-zend:  19:          action :create do
==> mongos-zend:  20:  
==> mongos-zend:  21:            unless sensitive_supported?
==> mongos-zend:  22:              Chef::Log.debug("Sensitive attribute disabled, chef-client version #{Chef::VERSION} is lower than 11.14.0")
==> mongos-zend:  23:            end
==> mongos-zend:  24:  
==> mongos-zend:  25:            package 'debconf-utils' do
==> mongos-zend:  26:              action :install
==> mongos-zend: 
==> mongos-zend: 
==> mongos-zend: 
==> mongos-zend: [2015-01-12T10:50:04-06:00] ERROR: Running exception handlers
==> mongos-zend: [2015-01-12T10:50:04-06:00] ERROR: Exception handlers complete
==> mongos-zend: [2015-01-12T10:50:04-06:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> mongos-zend: [2015-01-12T10:50:04-06:00] ERROR: uninitialized constant Opscode::Mysql
==> mongos-zend: [2015-01-12T10:50:04-06:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

$ chef-client -v Chef: 11.18.0.rc.1

$ vagrant -v Vagrant 1.6.5

The cookbook is coming through the berks supermarket which gets me - https://github.com/chef-cookbooks/mysql.

I can provide more information if someone has a suggestion for what to add. My hope is that someone sees this and recognizes this issue and has an idea of what to look for.

Shyamalan-esque twist: My coworker is using the same Vagrant/Chef repo I am and can run vagrant up with no issues. We have the same version of Vagrant and Chef, and everything else should be managed through with the Berksfile/Vagrantfile (which live in the repo).

lostphilosopher
  • 4,361
  • 4
  • 28
  • 39

2 Answers2

2

Your code relies on the mysql cookbook in a version < 6.0.

See the helper library in v5.6.1, where it resides in the Opscode::Mysql::Helpers namespace, versus helper library in v6.0.0 where it is in MysqlCookbook::Helpers.

I'm not sure, what your run list if you have your own top-level cookbook, but you can define version constraints in the depends part of metadata.rb (see docs).

StephenKing
  • 36,187
  • 11
  • 83
  • 112
  • That seems promising - investigating now. Why would I have this problem and someone else using the same repo not have this problem if that is the case? Thanks for the answer, I'll update if it works! – lostphilosopher Jan 12 '15 at 21:17
  • I am also not sure, it looks very weird. Because the code snippet that your logs show are from a 5.x version, not from a 6.x. Hove you messed with your berkshelf store (in `~/.berkshelf/cookbooks)- maybe delete the cookbooks from there? – StephenKing Jan 12 '15 at 21:27
  • I'm still running the `vagrant up` to confirm but on your suggestion I `rm -rf mysql-6.0.6` from my ~/.berkshelf/cookbooks dir and `rm -rf /chef-cookbooks` from my project. Then I ran a `vagrant destroy && vagrant up`. It LOOKS like that might have fixed the problem. It's as if what was in my dir as mysql-6.0.6 was actually something else, or buggy? I don't know... – lostphilosopher Jan 12 '15 at 21:36
  • BOOM. That fixed it. The `berks list` output hasn't changed, nor has the content of `ls chef-cookbooks/` or `ls ~/.berkshelf/cookbooks/` BUT after doing the removal steps describing above I'm no longer getting that error. Thank you! – lostphilosopher Jan 12 '15 at 21:56
0

Just looked at our includes -- we quote all the cookbook names. I'd start there.

Another thing could be case sensitivity -- depending on what the hosts filesystem is that can come into play.

Wyatt Barnett
  • 15,573
  • 3
  • 34
  • 53
  • I don't think is is the issue since the code in question is coming from that opscode git repo. It's not something I wrote. I expect if that was broken this issue would be more wide spread. Also, my coworker who isn't having this issue is running an identical mac. Thanks though! – lostphilosopher Jan 12 '15 at 21:07