Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cookbook throws LoadError exception - which is not handled by rescue #64

Open
jjeffers opened this issue Oct 16, 2014 · 4 comments
Open

Comments

@jjeffers
Copy link

When using this cookbook as part of a vagrant/chef-solo run, I see the following:

==> default: ================================================================================
==> default: Recipe Compile Error in /tmp/vagrant-chef-3/chef-solo-1/cookbooks/solo-search/libraries/search.rb
==> default: ================================================================================
==> default: 
==> default: 
==> default: Gem::LoadError
==> default: --------------
==> default: chef_gem[treetop] (dynamically defined) had an error: Gem::LoadError: Could not find 'treetop' (= 1.5.1) - did find: [treetop-1.5.3]
==> default: Checked in 'GEM_PATH=/root/.gem/ruby/1.9.1:/usr/lib/ruby/gems/1.9.1', execute `gem env` for more information
==> default: 
==> default: 
==> default: Cookbook Trace:
==> default: ---------------
==> default:   /tmp/vagrant-chef-3/chef-solo-1/cookbooks/solo-search/libraries/search.rb:33:in `<top (required)>'
==> default: 
==> default: 
==> default: Relevant File Content:
==> default: ----------------------
==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/solo-search/libraries/search.rb:
==> default: 
==> default:  26:    # All chef/solr_query/* classes were removed in Chef 11; Load vendored copy
==> default:  27:    # that ships with this cookbook
==> default:  28:    $: << File.expand_path("vendor", File.dirname(__FILE__)) if Chef::VERSION.to_i >= 11
==> default:  29:  
==> default:  30:    # Ensure the treetop gem is installed and available
==> default:  31:    treetop_loadable = false
==> default:  32:    begin
==> default:  33>>     gem 'treetop', '=1.5.1'
==> default:  34:      require 'treetop'
==> default:  35:      treetop_loadable = true
==> default:  36:    rescue LoadError
==> default:  37:      run_context = Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
==> default:  38:      chef_gem = Chef::Resource::ChefGem.new("treetop", run_context)
==> default:  39:      chef_gem.version('= 1.5.1')
==> default:  40:      chef_gem.run_action(:install)
==> default:  41:      #chef gem isn't run in whyrun mode
==> default:  42:      treetop_loadable = !Chef::Config[:why_run]
==> default: 
==> default: 
==> default: 
==> default: [2014-10-16T15:40:32+00:00] INFO: Forking chef instance to converge...
==> default: [2014-10-16T15:40:41+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
@michaelglass
Copy link

I would expect this if treetop had been yanked.

@michaelglass
Copy link

updated treetop to 1.5.3. Haven't dived in to see why this breaks, though.

@michaelglass
Copy link

please feel free to close if the issue goes away

@frankf-cgn
Copy link

I think that this error remains, it is just the second run which wil succeed, because then the gem "treetop" is installed. I have no idea, why despite the rescue-block this exception bubbles up. Anyone?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants