Closed Programie closed 5 years ago
I was able to trace down the issue to the plugindir
parameter of the elasticsearch
class. Once I manually specify the path to the plugins dir of Elasticsearch, Puppet is running as expected.
It looks like the hiera()
function, which is used in the common.yaml, is not available in Puppet 4.
@Programie the module is unit tested against puppet 4.5 up to version 5 and acceptance tests run for all distributions and multiple Elasticsearch versions on Puppet 4 (see the list of example tests here), so the module appears to still be working fine for the versions you indicated in testing, at least (and manually running manifests in example environments seems to work fine, as well).
It does seem that there's something wrong with the environment you're working in, though. You're probably right that the hiera call may be to blame given that it's the only class parameter that uses the hiera()
function in Hiera yaml. It should be available in Puppet 4, and in any case, it would fail in CI if the function weren't available in Puppet 4.x, so I don't think that's the issue.
Is there a way to reproduce the behavior you're describing? I can't force the error when I stand up a host and apply a simple manifest to configure Elasticsearch on version 4 of Puppet.
I've tested it in a completely empty environment containing only external modules (including other ones which are not required by Elasticsearch) and the issue still exists. I will test it once again in an empty environment only containing the Elasticsearch module and it's dependencies.
OK, now I've tested it using a completely empty environment containing only the required modules, but the issue still exists.
environment.conf
modulepath = external_modules
Puppetfile
moduledir 'external_modules'
mod 'puppetlabs/apt', '4.5.1'
mod 'puppetlabs/stdlib', '4.25.1'
mod 'richardc/datacat', '0.6.2'
mod 'elastic/elastic_stack', '6.1.0'
mod 'elastic/elasticsearch', '6.3.0'
manifests/test.pp
node "mynode" {
class { "elasticsearch":
version => "6.3.0"
}
}
So I'm using the following Vagrantfile to provision an example setup using Puppet 4, version 6.3.0 of the module, and Elasticsearch 6.3:
$ git clone https://gist.github.com/tylerjl/5cc29637040414de547801f08c8daa6b puppet
$ cd puppet
$ make
And elasticsearch seems to install/run fine. Is there something different I should be doing to get the behavior you're describing? I'm hoping there's some way to reproduce this so that we can know definitely when it's fixed with tests.
Applying the catalog locally using puppet apply
also works for me, but in combination with a Puppet master, the Puppet run fails.
Alright: I've updated that example Vagrant setup to be master/agent, and in doing so did see some weird problems where the elasticsearch_users provider couldn't autoload, though the error message looks different what you were reporting.
At this point I think there's a bug with type/provider loading that I may need to fix with some $LOAD_PATH
changes, but unsure whether it's the bug you're running into. Does the updated Vagrant setup work correctly for you, or can you get it to reproduce the erroring-out hiera()
behavior?
I just tried to test it in the Vagrant VM provided by you, but the used box boxcutter/centos73
is not available.
Hmm, that's strange. I've updated the Vagrant setup to use a Debian Jessie box (so it's the same as the system you reported this on, as well). Does that different box work for you with make
?
Sorry for the delayed answer.
I just tried your updated box but had to add apt install -y curl
to the Vagrantfile as the box doesn't contain curl which is called in the Makefile. After the modification, the box worked as expected and the curl call to localhost:9200 showed the expected Elasticsearch output: That JSON with the "You Know, for Search" tagline.
Maybe this is just an issue with my Puppet setup even if it's rather strange as it only happens in version 6.x.x of the module.
Someone else also had the same issue a while ago in which you were involved, too: https://discuss.elastic.co/t/elasticsearch-puppet-module-issue/111567
@Programie just to be totally clear, removing the hiera()
call in the data/common.yaml
file fixes your issue, is that correct? If that's the case, I can try and narrow down a test to try and reproduce that by trying some more hiera tests. If that doesn't work, then removing it and just populating the string manually isn't a huge deal, but I just want to verify that's the root cause with whatever environment you're running in.
Yes, removing the hiera()
call in the data/common.yaml
file fixes this issue. And simply specifying the plugindir
in the elasticsearch
class also fixes it.
For what it's worth, I encountered the same issue yesterday, running Puppet 4.8.1 (both server and agent) on CentOS 7, also resolved by setting configdir
.
@mrbanzai Can you expand on your fix?
Sorry! My previous comment was a typo; it required setting plugindir
as mentioned by @Programie .
Same environment, same error: master: 4.8.1 (Centos7) agent: 4.10.4 (Redhat 6.6)
@tylerjl Is able to have it fixed in future versions ?
I have a potential branch to fix this over in #1023. Can someone take the branch for a test drive to confirm whether this looks fixed for them in their environment?
The aforementioned fix PR should be included in 6.4.0
Bug description
The puppet run fails with the following error:
Stacktrace shown on the Puppet Master:
Example node definition:
The module works fine on Puppet 5 but not on Puppet 4, but the documentation says it requires Puppet >= 4.5.0 < 6.0.0.