voxpupuli / puppet-elasticsearch

Elasticsearch Puppet module
Apache License 2.0
403 stars 478 forks source link

Error while evaluating a Virtual Query #990

Open madelaney opened 6 years ago

madelaney commented 6 years ago

Bug description

When applying a puppet catalog, I get the following error:

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: Could not autoload puppet/provider/elasticsearch_user/elasticsearch_users: no such file to load -- puppet/provider/elastic_user_command at /etc/puppetlabs/code/thirdparty/elasticsearch/manifests/init.pp:554:3 on node vagrant-hostname
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

I have the following setup:

node default {
  class {
    'elasticsearch':
      plugindir        => '/usr/share/elasticsearch/plugins',
  }
}

With the following hiera config

---
elasticsearch::restart_on_change: true
elasticsearch::api_protocol: https
elasticsearch::api_host: "%{ipaddress}"
elasticsearch::api_timeout: 60
elasticsearch::api_basic_auth_username: admin
elasticsearch::api_basic_auth_password: adminpassword
elasticsearch::api_ca_file: /etc/ssl/certs
elasticsearch::api_ca_path: /etc/pki/certs
elasticsearch::validate_tls: true
elasticsearch::jvm_options:
  - '-Xms1g'
  - '-Xmx2g'
elasticsearch::security_plugin: 'x-pack'
elasticsearch::roles:
  poweruser:
    privileges:
      cluster: monitor
      indices:
        '*': all
    mappings:
    - "cn=users,dc=example,dc=com"
elasticsearch::users:
  bob:
    password: 'bob12345'
  admin:
    password: 'admin12345'
elasticsearch::instances:
  es01: {}
  es02: {}

Feature Description

tylerjl commented 6 years ago

Hi @madelaney, after installing the module, have you restarted any puppet master/agent processes in order to ensure those files are available? Puppet sometimes behaves unexpectedly if you update/install a module without restarting the master/agent process afterwards.

madelaney commented 6 years ago

@tylerjl part of my capistrano deployment issues the puppetserver reload command, should that be puppetserver restart?

madelaney commented 6 years ago

@tylerjl For what it's worth, I've tried changing puppetserver reload to puppetserver restart but to no avail.

tylerjl commented 5 years ago

Hmm, I'd perhaps double check that 1) pluginsync is enabled, 2) the module has been installed to the correct path with all files intact (including the typical lib/ path, etc.) and 3) try restarting the Puppet service via the system init manager (not just puppetserver) with systemctl or service, for example.

marclambrichs commented 5 years ago

Run a 'puppet generate types' and a 'service puppetserver restart'

madelaney commented 5 years ago

@marclambrichs Okay, i'll give that a shot. Thanks.

madelaney commented 5 years ago

@marclambrichs I tried to run puppet generate types but to no avail the command fails with a not very helpful message:

Error: no implicit conversion of nil into String
Error: Try 'puppet help generate types' for usage
Exit 1
tylerjl commented 5 years ago

I'm not aware of the puppet generate types command - @marclambrichs, since you seem more familiar with it, is that command necessary in order to bring in custom types in recent versions of puppet? I don't recall having to use it before.

madelaney commented 5 years ago

@tylerjl The machine that is running puppet off of has pretty poor i/o (disk) performance. Is it possible that there's a timeout that is being swallowed somewhere?

tylerjl commented 5 years ago

@madelaney I'm not aware of i/o problems that could impact it, though maybe increasing the log verbosity could help pinpoint where in the catalog application process things are breaking.

madelaney commented 5 years ago

@tylerjl I was running with --verbose and --test but they still yield not helpful; or so I think. For your viewing pleasure, here is the stack trace in the puppetserver.log.

alaunay commented 5 years ago

I'm hitting this too. 6.3.2 works, 6.3.3 gives the same error @madelaney gets.

madelaney commented 5 years ago

I tried 6.3.2 in hopes that my scenario would mirror that of @alaunay but I still get the issue.

(After downgrading, I issued puppetserver restart)

alaunay commented 5 years ago

Actually, it worked for one server, but for another one I had to downgrade to 6.3.0 (or even to 6.2, I'm unsure). After that, upgrading again to the last version still worked. Very strange.