# Elasticsearch fails to get installed when Elasticsearch Puppet module is upgraded to 0.13.2

**URL:** https://discuss.elastic.co/t/elasticsearch-fails-to-get-installed-when-elasticsearch-puppet-module-is-upgraded-to-0-13-2/61304
**Category:** Elasticsearch
**Created:** [September 22, 2016, 7:14pm UTC](https://discuss.elastic.co/t/elasticsearch-fails-to-get-installed-when-elasticsearch-puppet-module-is-upgraded-to-0-13-2/61304 "2016-09-22T19:14:03Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sandeepkanabar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepkanabar/32/79399_2.png) [@sandeepkanabar](https://discuss.elastic.co/u/sandeepkanabar)
#### Post date: [September 22, 2016, 7:14pm UTC](https://discuss.elastic.co/t/elasticsearch-fails-to-get-installed-when-elasticsearch-puppet-module-is-upgraded-to-0-13-2/61304/1 "2016-09-22T19:14:03Z")

</div>

@tylerjl  
I upgraded elasticsearch puppet module from 0.10.3 to 0.13.2. When I run puppet apply using the below command, elasticsearch fails to get installed.

`puppet apply /etc/puppet/environments/dbe_metrics/manifests/site.pp --environment=dbe_metrics --debug`

The error that I get is:

> Debug: Puppet::Type::Elasticsearch\_plugin::ProviderElasticsearch\_plugin: file /usr/share/elasticsearch/bin/elasticsearch-plugin does not exist  
> Debug: Creating default schedules

I've uploaded the following files to [gist](https://gist.github.com/sandeepkanabar/733931975697743e1a3b8df86f3f7acb):

1. profile elasticsearch\_cluster.pp that installs elasticsearch and also installs plugins
2. the role es\_logstash.pp that is invoked when the main manifest site.pp is called
3. ndd\_common.yaml - hieradata file
4. puppet-apply-debug.txt - debug run of puppet apply that contains full log
5. site.pp

My code runs quite fine with Elasticsearch puppet module 0.10.3.

Any pointers?

---

<div class="post-metadata">

### Author: ![tylerjl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylerjl/32/44965_2.png) [@tylerjl](https://discuss.elastic.co/u/tylerjl)
#### Post date: [September 22, 2016, 8:29pm UTC](https://discuss.elastic.co/t/elasticsearch-fails-to-get-installed-when-elasticsearch-puppet-module-is-upgraded-to-0-13-2/61304/2 "2016-09-22T20:29:38Z")

</div>

Hey @sandeepkanabar! I'll try and explain what's happening here:

Because the module manages plugins as native puppet types, at the beginning of each puppet run (before it takes any actions), puppet will try and enumerate existing "instances" for native types that may exist on the system. It figures out what native types to look for by checking that executables or files exist, and skips checks for those that don't. What you're seeing is this pre-run stage look for the plugin executables and fail to find them, so it doesn't do the initial check to see what plugins are installed before managing them.

To demonstrate, I ran a dummy manifest on a clean CentOS 6 VM and got similar output, but later on in the puppet run (once those executables are installed) the run continues just fine and calls the `plugin` command:

```auto
Notice: Compiled catalog for localhost.local in environment production in 1.43 seconds
Debug: Puppet::Type::Elasticsearch_plugin::ProviderElasticsearch_plugin: file /usr/share/elasticsearch/bin/elasticsearch-plugin does not exist
Debug: Puppet::Type::Elasticsearch_plugin::ProviderPlugin: file /usr/share/elasticsearch/bin/plugin does not exist
Debug: Puppet::Type::Elasticsearch_plugin::ProviderElasticsearch_plugin: file /usr/share/elasticsearch/bin/elasticsearch-plugin does not exist
Debug: Puppet::Type::Elasticsearch_plugin::ProviderPlugin: file /usr/share/elasticsearch/bin/plugin does not exist
Debug: Creating default schedules

...many lines later...

Notice: /Stage[main]/Main/Elasticsearch::Plugin[lmenezes/elasticsearch-kopf]/Elasticsearch_plugin[lmenezes/elasticsearch-kopf]/ensure: created

```

Those types of debug messages aren't necessarily indicative of a failed run, so we probably need to look at the entirety of the logs for the puppet run to see what's happening. If Elasticsearch isn't getting installed, the error probably happens sometime after that debug message about `bin/plugin` missing.

---

<div class="post-metadata">

### Author: ![sandeepkanabar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepkanabar/32/79399_2.png) [@sandeepkanabar](https://discuss.elastic.co/u/sandeepkanabar)
#### Post date: [September 22, 2016, 9:16pm UTC](https://discuss.elastic.co/t/elasticsearch-fails-to-get-installed-when-elasticsearch-puppet-module-is-upgraded-to-0-13-2/61304/3 "2016-09-22T21:16:14Z")

</div>

@tylerjl

Thank you very much for the detailed explanation. Thanks for doing a quick test with dummy manifest. From the output you pasted, it seems that while your execution goes ahead after `Debug: Creating default schedules`, mine throws the following error messages after `default schedules` Line.

During my first run I got this error message `Error: Could not find dependent File[/usr/share/elasticsearch/plugins] for File[/usr/share/elasticsearch/plugins/shield`. During the second run, I got this error message:

`Error: Could not find dependent File[/usr/share/elasticsearch/plugins] for File[/usr/share/elasticsearch/plugins/marvel-agent] at /etc/puppet/modules/elasticsearch/manifests/plugin.pp:174`

That's all. There is nothing else in puppet logs. Does this give some clue?

---

<div class="post-metadata">

### Author: ![tylerjl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylerjl/32/44965_2.png) [@tylerjl](https://discuss.elastic.co/u/tylerjl)
#### Post date: [September 22, 2016, 10:09pm UTC](https://discuss.elastic.co/t/elasticsearch-fails-to-get-installed-when-elasticsearch-puppet-module-is-upgraded-to-0-13-2/61304/4 "2016-09-22T22:09:47Z")

</div>

Ah, I think I see where the bug is. I've [filed an issue to fix this one](https://github.com/elastic/puppet-elasticsearch/issues/706).

In the meantime, I think you should be able to work around this issue with something like the following in your puppet manifest:

```auto
file { $::elasticsearch::plugindir:
  ensure => directory,
  require => Class['elasticsearch::config'],
}

```

There may be some additional ordering parameters you may need to specify, but that's one workaround you can think of. Let me know how far this gets you.

---

<div class="post-metadata">

### Author: ![sandeepkanabar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepkanabar/32/79399_2.png) [@sandeepkanabar](https://discuss.elastic.co/u/sandeepkanabar)
#### Post date: [September 23, 2016, 5:02pm UTC](https://discuss.elastic.co/t/elasticsearch-fails-to-get-installed-when-elasticsearch-puppet-module-is-upgraded-to-0-13-2/61304/5 "2016-09-23T17:02:52Z")

</div>

Thank you very much @tylerjl. I'll try that. Thanks for filing the bug. As of now, we have decided to use the existing 0.10.3 module since we need to deliver it to customer ASAP. But once it's delivered and I've some time in hand, I'll give your suggestion a try and upgrade to the latest one.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 10:17pm UTC](https://discuss.elastic.co/t/elasticsearch-fails-to-get-installed-when-elasticsearch-puppet-module-is-upgraded-to-0-13-2/61304/6 "2017-07-05T22:17:37Z")

</div>


