Skip to content

Plugin install isn't idempotent #392

@spuder

Description

@spuder

I find that installing some plugins doesn't work on subsequent chef runs. It gives the error

ERROR: plugin directory /usr/share/elasticsearch/plugins/hq already exists.
           Cookbook Trace:
           ---------------
           /tmp/kitchen/cookbooks/elasticsearch/libraries/provider_plugin.rb:44:in `block (2 levels) in <class:PluginProvider>'
           /tmp/kitchen/cookbooks/elasticsearch/libraries/provider_plugin.rb:27:in `block in <class:PluginProvider>'

           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cookbooks/nd-elasticsearch/recipes/default.rb

            70: elasticsearch_plugin 'royrusso/elasticsearch-HQ' do
            71:   action :install
            72: end

           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cookbooks/nd-elasticsearch/recipes/default.rb:70:in `from_file'

           elasticsearch_plugin("royrusso/elasticsearch-HQ") do
             action [:install]
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             declared_type :elasticsearch_plugin
             cookbook_name :"nd-elasticsearch"
             recipe_name "default"
             plugin_name "royrusso/elasticsearch-HQ"
           end


       Running handlers:
       [2015-11-21T06:06:41+00:00] ERROR: Running exception handlers
       Running handlers complete
       [2015-11-21T06:06:41+00:00] ERROR: Exception handlers complete
       Chef Client failed. 7 resources updated in 01 minutes 08 seconds
       [2015-11-21T06:06:41+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2015-11-21T06:06:41+00:00] ERROR: elasticsearch_plugin[royrusso/elasticsearch-HQ] (nd-elasticsearch::default line 70) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '74'
       ---- Begin output of ["/usr/share/elasticsearch/bin/plugin", "install", "royrusso/elasticsearch-HQ"] ----
       STDOUT: -> Installing royrusso/elasticsearch-HQ...
       Trying https://github.com/royrusso/elasticsearch-HQ/archive/master.zip ...
       Downloading ...................................................................................................................................................................DONE
       Verifying https://github.com/royrusso/elasticsearch-HQ/archive/master.zip checksums if available ...
       NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
       ERROR: plugin directory /usr/share/elasticsearch/plugins/hq already exists. To update the plugin, uninstall it first using 'remove hq' command
       STDERR:
       ---- End output of ["/usr/share/elasticsearch/bin/plugin", "install", "royrusso/elasticsearch-HQ"] ----
       Ran ["/usr/share/elasticsearch/bin/plugin", "install", "royrusso/elasticsearch-HQ"] returned 74
       [2015-11-21T06:06:41+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> Converge failed on instance <default-ubuntu-1404>.
>>>>>> Please see .kitchen/logs/default-ubuntu-1404.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sh -c '

sudo -E /opt/chef/bin/chef-solo --config /tmp/kitchen/solo.rb --log_level auto --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json
']
>>>>>> ----------------------

Strangely it doesn't manifest itself with every plugin.

royrusso/elasticsearch-HQ Always fails the second converge however lmenezes/elasticsearch-kopf and mobz/elasticsearch-head succeed.

I can't find any documentation showing why HQ might not work. My theory is that maybe it doesn't support ES 2.0.0

elasticsearch_plugin 'mobz/elasticsearch-head' do
  action :install
end

# Paramedic currently doesn't want to install on es 2.0.0. I emailed creator since no github issues enabled.
# elasticsearch_plugin 'karmi/elasticsearch-paramedic' do
#   action :install
# end

elasticsearch_plugin 'lmenezes/elasticsearch-kopf' do
  action :install
end

elasticsearch_plugin 'royrusso/elasticsearch-HQ' do
   action :install
 end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions