puppet-elasticsearch: Could not autoload puppet/provider/elasticsearch_user_file/oss_xpack

  • Module version: 6.3.3
  • Puppet version: 4.10.12
  • OS and version:Debian GNU/Linux 9.5 (stretch)

Bug description

Hello,

I have install elasticsearch 6.3.2 with puppet module version 6.2.2 but I have the scripts symlink bug.

So I have update elasticsearch module to 6.3.3. I have made change on my manifest to take care of change ( oss + repository)

But now when I try to apply manifest :

 ~# puppet agent -t
Info: Using configured environment 'my_build_branch'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Virtual Query, Could not autoload puppet/type/elasticsearch_user_file: Could not autoload puppet/provider/elasticsearch_user_file/oss_xpack: undefined method `oss_xpack_config' for Puppet::Type::Elasticsearch_user_file::ProviderOss_xpack:Class at /etc/puppetlabs/code/environments/my_build_branch/modules/elasticsearch/manifests/init.pp:555:6 on node my.server
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Have you an idea ? this was introduce in 6.3.0.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 24 (7 by maintainers)

Commits related to this issue

Most upvoted comments

After some research, I found a ticket which seems relating this issue. -> https://tickets.puppetlabs.com/browse/PUP-3513 It seems to be due that puppetserver doesn’t generate metadata from freshly pulled modules for a specific environment. It is recommended to use Environment Isolation to avoid this problem. Issuing a puppet generate types --environment {env} directly after a puppet-code deploy or a r10k puppetfile install fixes this issue and with --force flag after each puppetserver updates. Cf. https://puppet.com/docs/puppet/6.5/environment_isolation.html#reference-6554

I tested and it works There are 3 files that need to be touched

#egrep -r “elastic_user_command” /etc/puppetlabs/code/environments/development/modules/elasticsearch/lib/puppet/provider/

/etc/puppetlabs/code/environments/development/modules/elasticsearch/lib/puppet/provider/elasticsearch_user/elasticsearch_users.rb:require ‘puppet/provider/elastic_user_command’ /etc/puppetlabs/code/environments/development/modules/elasticsearch/lib/puppet/provider/elasticsearch_user/users.rb:require ‘puppet/provider/elastic_user_command’ /etc/puppetlabs/code/environments/development/modules/elasticsearch/lib/puppet/provider/elasticsearch_user/esusers.rb:#require ‘puppet/provider/elastic_user_command’

I ended up with some ugly sed

sed -i ‘s/require ‘'‘puppet/provider/elastic_user_command’'’/require File.join(File.dirname(__FILE__), ‘'’..’'‘,’'‘..’'‘,’'‘..’'‘, ‘'‘puppet/provider/elastic_user_command’'’/’ /etc/puppetlabs/code/environments/development/modules/elasticsearch/lib/puppet/provider/elasticsearch_user/*

Why is this fix not yet merged ?

Any update on this? We’re still seeing failures on these providers in our logs after any puppetserver restart.

I too can confirm that this fixes the failures (using puppet 6.0) and I have created a PR with the change.

Puppet Agent version: 5.5.6 Puppet Server version: 5.3.5 Module version: 6.3.3 OS and version:Debian GNU/Linux 9.5 (stretch)

We are seeing similar issues but only when the puppet server is restarted. And starts working on the 3rd re-try (with no changes).

Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Virtual Query, Could not autoload puppet/type/elasticsearch_user: Could not autoload puppet/provider/elasticsearch_user/esusers: no such file to load -- puppet/provider/elastic_user_command (file: /etc/puppetlabs/code/environments/production/modules/elasticsearch/manifests/init.pp, line: 554, column: 3)

@tylerjl I assume you mean changing the require statement in the elasticsearch_user provider [1] to something like:

require File.join(File.dirname(__FILE__), '..','..','..', 'puppet/provider/elastic_user_command')

(And in all other places where it’s required)

Would that really be disruptive? We’ve been using this in other modules and I dont think this would cause any issues, maybe I’m missing something

Best regards

[1] https://github.com/elastic/puppet-elasticsearch/blob/master/lib/puppet/provider/elasticsearch_user/esusers.rb

I can +1 what @scamfield reports - Success after 3 failed puppet runs following a server restart

edit: Puppet Agent version: 5.5.8 Puppet Server version: 5.3.6 Module version: 6.3.0 OS and version:Ubuntu 16.04 (Xenial)