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

Failure to locate 'elasticsearch.conf.erb' template #184

Closed
brandocorp opened this issue Feb 11, 2014 · 8 comments
Closed

Failure to locate 'elasticsearch.conf.erb' template #184

brandocorp opened this issue Feb 11, 2014 · 8 comments

Comments

@brandocorp
Copy link

I was running through the tutorial setup on an m1.large amzn-ami-pv-2013.09.2.x86_64-ebs (ami-bba18dd2), when I encountered the following error.
I am not sure if this is an issue with the monit cookbook, or the elasticsearch::monit recipe.

Recipe: elasticsearch::monit
  * log[Making monitrc for: elasticsearch] action write

  * template[/etc/monit/conf.d/elasticsearch.conf] action create
================================================================================
Error executing action `create` on resource 'template[/etc/monit/conf.d/elasticsearch.conf]'
================================================================================


Chef::Exceptions::FileNotFound
------------------------------
Cookbook 'elasticsearch' (0.3.7) does not contain a file at any of these locations:
  templates/amazon-2013.09/elasticsearch.conf.erb
  templates/amazon/elasticsearch.conf.erb
  templates/default/elasticsearch.conf.erb

This cookbook _does_ contain: ['/var/chef-solo/cookbooks/elasticsearch/templates/default/nginx.conf.erb','/var/chef-solo/cookbooks/elasticsearch/templates/default/nginx.monitrc.conf.erb','/var/chef-solo/cookbooks/elasticsearch/templates/default/elasticsearch.yml.erb','/var/chef-solo/cookbooks/elasticsearch/templates/default/elasticsearch.init.erb','/var/chef-solo/cookbooks/elasticsearch/templates/default/elasticsearch.monitrc.conf.erb','/var/chef-solo/cookbooks/elasticsearch/templates/default/elasticsearch-env.sh.erb','/var/chef-solo/cookbooks/elasticsearch/templates/default/elasticsearch_proxy.conf.erb','/var/chef-solo/cookbooks/elasticsearch/templates/default/logging.yml.erb']


Resource Declaration:
---------------------
# In /var/chef-solo/site-cookbooks/monit/libraries/monitrc.rb

  8:       template "/etc/monit/conf.d/#{name}.conf" do
  9:         owner "root"
 10:         group "root"
 11:         mode 0644
 12:         source "#{name}.conf.erb"
 13:         variables variables
 14:         notifies :restart, resources(:service => "monit"), reload
 15:         action :create
 16:       end
 17:     end



Compiled Resource:
------------------
# Declared in /var/chef-solo/site-cookbooks/monit/libraries/monitrc.rb:8:in `monitrc'

template("/etc/monit/conf.d/elasticsearch.conf") do
  provider Chef::Provider::Template
  action [:create]
  retries 0
  retry_delay 2
  path "/etc/monit/conf.d/elasticsearch.conf"
  backup 5
  atomic_update true
  source "elasticsearch.conf.erb"
  cookbook_name :elasticsearch
  recipe_name "monit"
  owner "root"
  group "root"
  mode 420
end



[2014-02-11T00:59:31+00:00] ERROR: Running exception handlers
[2014-02-11T00:59:31+00:00] ERROR: Exception handlers complete
[2014-02-11T00:59:31+00:00] FATAL: Stacktrace dumped to /var/chef-solo/chef-stacktrace.out
Chef Client failed. 7 resources updated
[2014-02-11T00:59:32+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

The quick and dirty fix was to run the following:

sudo cp /var/chef-solo/cookbooks/elasticsearch/templates/default/elasticsearch{.monitrc,}.conf.erb
@karmi
Copy link
Contributor

karmi commented Feb 11, 2014

I'm wondering if this is not related to an older/different version of the Monit cookbook.

There's been similar issue being reported in #29, but 42db58c and other changes should have fixed that.

I'm leaning towards completely ripping out the reliance on monitrc method and just putting the file for Monit somewhere on the disk.

@brandocorp
Copy link
Author

I will grab the cookbook versions for you, and try and do a bit of troubleshooting on the run if I have some time today.

If it helps I was following along with this guide:
http://www.elasticsearch.org/tutorials/deploying-elasticsearch-with-chef-solo/

Edit:
Looks like the bootstrap.sh script is pulling a very specific version of [email protected]. I'm going to try another run with the latest version.

@brandocorp
Copy link
Author

This was an issue with the version of monit that was being pulled in. I updated to the latest and everything worked flawlessly. Thank you!

@karmi
Copy link
Contributor

karmi commented Feb 11, 2014

Yeah, I suspected that was it... I remember trying to use the correct version via Berkshelf integration, but maybe the tutorial is falling behind it...

Still, I think we should just drop the monitrc extension and just create the file via template and that's it. Will keep that in mind for future refactorings.

@brupm
Copy link

brupm commented Feb 14, 2014

I am currently running into this issue, installed latest version of monit: 5.6 and it is still a problem. Any ideas?

@karmi
Copy link
Contributor

karmi commented Feb 14, 2014

@brupm Run from Git...

@brupm
Copy link

brupm commented Feb 14, 2014

You mean, don’t install via apt-get install monit in the bootstrap.sh?

Bruno Miranda

On Friday, February 14, 2014 at 11:24 AM, Karel Minarik wrote:

@brupm (https://github.com/brupm) Run from Git... (https://github.com/elasticsearch/cookbook-elasticsearch/blob/master/Berksfile#L9)


Reply to this email directly or view it on GitHub (#184 (comment)).

@karmi
Copy link
Contributor

karmi commented Feb 14, 2014

@brupm apt-get installs Monit itself, what I've meant is using the cookbook from Git, as the Berkshelf specifies..

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