edelight / chef-solo-search

Data bag search for Chef Solo
Apache License 2.0
177 stars 2 forks source link

chef_gem[treetop] (dynamically defined) had an error: NoMethodError: undefined method `full_name' for nil:NilClass #34

Open runningman84 opened 11 years ago

runningman84 commented 11 years ago

I am unable to use chef-solo-search behind a http proxy. I tried to configure the proxy in the vm_aws recipe:

ENV['http_proxy'] = "http://192.168.99.5:3128/"
ENV['https_proxy'] = "http://192.168.99.5:3128/"
Chef::Config[:http_proxy] = ENV['http_proxy']

but I get this error

Setting up chef (11.4.4-2.ubuntu.11.04) ...
Thank you for installing Chef!
[db1aws] Running provisioner: chef_solo...
Generating chef JSON and uploading...
Running chef-solo...
stdin: is not a tty
[2013-06-05T12:05:47+00:00] INFO: *** Chef 11.4.4 ***
[2013-06-05T12:05:49+00:00] INFO: Setting the run_list to ["role[vm_aws]", "role[dbsrv_single]"] from JSON
[2013-06-05T12:05:49+00:00] INFO: Run List is [role[vm_aws], role[dbsrv_single]]
[2013-06-05T12:05:49+00:00] INFO: Run List expands to [els_base::ec2, chef-solo-search, apt, apt::cacher-client, mongodb::10gen_repo, vim, collectd, els_base, els_mongo, mongodb::default]
[2013-06-05T12:05:49+00:00] INFO: Starting Chef Run for ip-192-168-99-11.eu-west-1.compute.internal
[2013-06-05T12:05:49+00:00] INFO: Running start handlers
[2013-06-05T12:05:49+00:00] INFO: Start handlers complete.
[2013-06-05T12:05:49+00:00] INFO: Processing chef_gem[treetop] action install (dynamically defined)

================================================================================

Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/chef-solo-search/libraries/search.rb

================================================================================

NoMethodError

-------------

chef_gem[treetop] (dynamically defined) had an error: NoMethodError: undefined method `full_name' for nil:NilClass

Cookbook Trace:

---------------

  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/chef-solo-search/libraries/search.rb:37:in `rescue in <top (required)>'
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/chef-solo-search/libraries/search.rb:31:in `<top (required)>'

Relevant File Content:

----------------------

/tmp/vagrant-chef-1/chef-solo-1/cookbooks/chef-solo-search/libraries/search.rb:

 30:    # Ensure the treetop gem is installed and available
 31:    begin
 32:      require 'treetop'
 33:    rescue LoadError
 34:      run_context = Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
 35:      chef_gem = Chef::Resource::ChefGem.new("treetop", run_context)
 36:      chef_gem.version('>= 1.4')
 37>>     chef_gem.run_action(:install)
 38:    end
 39:  
 40:    require 'search/overrides'
 41:    require 'search/parser'
 42:  
 43:    module Search; class Helper; end; end
 44:  
 45:    # The search and data_bag related methods moved form `Chef::Mixin::Language`
 46:    # to `Chef::DSL::DataQuery` in Chef 11.

[2013-06-05T12:06:52+00:00] ERROR: Running exception handlers
[2013-06-05T12:06:52+00:00] ERROR: Exception handlers complete
[2013-06-05T12:06:52+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2013-06-05T12:06:52+00:00] FATAL: NoMethodError: chef_gem[treetop] (dynamically defined) had an error: NoMethodError: undefined method `full_name' for nil:NilClass
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
michaelglass commented 10 years ago

this looks like an issue related to installing the treetop gem. I couldn't repro. Halp?

benlangfeld commented 10 years ago

All that's required is a ubuntu bento box and including chef-solo-search in the runlist, you'll see this occur very readily. Unfortunately this makes this cookbook entirely useless right now, and I'm not sure what the solution is.

benlangfeld commented 10 years ago

I note this cookbook doesn't have test-kitchen setup. I'll add it and submit a PR for an easy demo of this issue.