Elasticsearch puppet module issue

Hi All,

I'm trying to install Elasticsearch 6.0 via Puppet Enterprise 2016.5.x using the mod 'elastic-elasticsearch', '6.0.0' (with all necessary dependencies). In the manifest I'm calling:

class { 'elasticsearch':
   version          => '6.0.0'
}

But when I run Puppet I get error:

Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, undefined method `pop' for nil:NilClass

at line with 'elasticsearch' class. It works fine if I use Puppet module for Elasticsearch earlier version. But earlier version is not compatible with Elasticsearch 6.x. Could you please help with this issue?

Hi, could you share the output of trying to run your Puppet manifest with --trace as well to get the full Ruby stack trace?

Hi Tyler, trace is:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: 
Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, undefined method `pop' for nil:NilClass at /etc/puppetlabs/code/environments/<our_environment_name>/modules/<our_module>/manifests/elasticsearch.pp:180:3 on node <our_node_name>
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/rest.rb:269:in `is_http_200?'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/rest.rb:167:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:194:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:434:in `block in retrieve_new_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:386:in `block in thinmark'
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:385:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:433:in `retrieve_new_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:78:in `retrieve_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:147:in `prepare_and_retrieve_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:309:in `run_internal'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:221:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:241:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:195:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:45:in `block (4 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent/locker.rb:21:in `lock'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:45:in `block (3 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:98:in `with_client'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:42:in `block (2 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:65:in `run_in_fork'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:41:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:179:in `call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:179:in `controlled_run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:39:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:353:in `onetime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:331:in `run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:540:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'

Interesting; the stack trace doesn't actually touch any parts of the Elasticsearch module, but instead just mentions normal Puppet components with the exception originating at /etc/puppetlabs/code/environments/<our_environment_name>/modules/<our_module>/manifests/elasticsearch.pp:180:3. Is there any possibility that the issue could be related to other parts of your module/manifest? There's no mention of any part of the Elasticsearch module that I could look into here.

yes, agree that it's strange. But it works fine if I use
mod 'elastic-elasticsearch', '5.5.0'
in my Puppetfile without any changes in module/manifest:

class { 'elasticsearch':
    ensure           => 'present',
    version          => $el_version,
    package_pin      => false,
    manage_repo      => true,
    security_plugin  => $security_plugin,
    jvm_options      => $jvm_options,
    logging_template => "${module_name}/elasticsearch/log4j2.properties.erb",
    repo_version     => $el_repo_version,
    datadir          => [ $el_datadir ],
    logdir           => $el_logdir,
    config           => $es_config,
    restart_on_change       => $restart_on_change,
    require                 => File[$dir],
 }

And as I said in the first message I also tried simplified definition:

class { 'elasticsearch':
   version          => '6.0.0'
}

with the same result.

Is this setup using a Puppetmaster? The log output you included doesn't mention anything about the Elasticsearch module, but if the catalog is being compiled on the Puppetmaster, the master's logs should include some logging about why the catalog compilation failed.

Yes, it's Puppetmaster. I've checked maser's logs but didn't find anything intresting

Unfortunately that leaves us at a bit of a dead-end, as the acceptance tests in Travis-CI continue to pass against Elasticsearch 6.0 and 6.1 and there's nothing particularly different in the example 6.0 you provided that I could try to reproduce the issue with. If there's something different in your environment that I could try and replicate the issue with I could try that, but as it stands there's not much else to go off of.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.