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

uninitialized constant Extensions during Vagrant provisioning #212

Closed
aaroncraigongithub opened this issue May 21, 2014 · 7 comments
Closed

Comments

@aaroncraigongithub
Copy link

I'm using the latest cookbook from git:

In Cheffile

cookbook 'elasticsearch', :git => 'git@github.com:elasticsearch/cookbook-elasticsearch.git'

My recipe:

include_recipe 'elasticsearch::default'

And during provisioning, I get the following error:

==> default: NameError
==> default: ---------
==> default: uninitialized constant Extensions
==> default:
==> default:
==> default: Cookbook Trace:
==> default: ---------------
==> default:   /tmp/vagrant-chef-3/chef-solo-1/cookbooks/elasticsearch/recipes/default.rb:1:in `block in from_file'
==> default:   /tmp/vagrant-chef-3/chef-solo-1/cookbooks/elasticsearch/recipes/default.rb:1:in `each'
==> default:   /tmp/vagrant-chef-3/chef-solo-1/cookbooks/elasticsearch/recipes/default.rb:1:in `from_file'
==> default:   /tmp/vagrant-chef-3/chef-solo-2/cookbooks/services/recipes/elasticsearch.rb:1:in `from_file'
==> default:   /tmp/vagrant-chef-3/chef-solo-2/cookbooks/bootstrap-dsc-sites/recipes/default.rb:37:in `from_file'
==> default:
==> default:
==> default: Relevant File Content:
==> default: ----------------------
==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/elasticsearch/recipes/default.rb:
==> default:
==> default:   1>> [Chef::Recipe, Chef::Resource].each { |l| l.send :include, ::Extensions }
==> default:   2:
==> default:   3:  Erubis::Context.send(:include, Extensions::Templates)
==> default:   4:
==> default:   5:  elasticsearch = "elasticsearch-#{node.elasticsearch[:version]}"
==> default:   6:
==> default:   7:  include_recipe "elasticsearch::curl"
==> default:   8:  include_recipe "ark"
==> default:   9:
==> default:  10:  # Create user and group

This doesn't look like a configuration issue, but maybe I'm missing something?

Vagrant 1,6.2
Host: OSX 10.9.2
Guest: Ubuntu 13.10

@ghost
Copy link

ghost commented Jul 2, 2014

+1

@ghost
Copy link

ghost commented Jul 3, 2014

I was getting this when I was including the ES recipe in another recipe that I was actually calling.

So in MY recipe, I put -- at the top -- :

class Chef::Recipe
  include Extensions
end

And then stuff works.

@mhalligan
Copy link

+1

@mhalligan
Copy link

Bernzbroad where do you put this change? I've tried to put it in the recipe where Im calling it, as well as within elasticsearch/recipes/default .. the error never goes away. What version of chef are you using? I'm stuck on 11.4 in opsworks.

@pschrammel
Copy link

Have the same error. It seems chef solo does not require the libraries automatically. Any solutions?
I tried to just copy the content of the libraries dir to my libraries dir but then I get another error (ark's defaults are not loaded properly so the node.ark == nil )

@pschrammel
Copy link

Found the solution: include "depends 'elasticsearch'" in your metafile so that elasticsearch is initialized . After that create your wrapper recipe as described. Works like a charm.

@martinb3
Copy link
Contributor

martinb3 commented Jul 6, 2015

Hello! It sounds like you were able to get this working. In the meantime, we've re-written the cookbook using libraries that expose resources and providers, so you shouldn't see this problem on the newer version. Hope this helps!

@martinb3 martinb3 closed this as completed Jul 6, 2015
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

4 participants