{"action":"opened","issue":{"url":"https://api.github.com/repos/elastic/cookbook-elasticsearch/issues/392","labels_url":"https://api.github.com/repos/elastic/cookbook-elasticsearch/issues/392/labels{/name}","comments_url":"https://api.github.com/repos/elastic/cookbook-elasticsearch/issues/392/comments","events_url":"https://api.github.com/repos/elastic/cookbook-elasticsearch/issues/392/events","html_url":"https://github.com/elastic/cookbook-elasticsearch/issues/392","id":118174119,"number":392,"title":"Plugin install isn't idempotent","user":{"login":"spuder","id":242382,"avatar_url":"https://avatars.githubusercontent.com/u/242382?v=3","gravatar_id":"","url":"https://api.github.com/users/spuder","html_url":"https://github.com/spuder","followers_url":"https://api.github.com/users/spuder/followers","following_url":"https://api.github.com/users/spuder/following{/other_user}","gists_url":"https://api.github.com/users/spuder/gists{/gist_id}","starred_url":"https://api.github.com/users/spuder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spuder/subscriptions","organizations_url":"https://api.github.com/users/spuder/orgs","repos_url":"https://api.github.com/users/spuder/repos","events_url":"https://api.github.com/users/spuder/events{/privacy}","received_events_url":"https://api.github.com/users/spuder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-21T06:23:33Z","updated_at":"2015-11-21T06:23:33Z","closed_at":null,"body":"I find that installing some plugins doesn't work on subsequent chef runs. It gives the error\r\n\r\n    ERROR: plugin directory /usr/share/elasticsearch/plugins/hq already exists.\r\n\r\n```\r\n           Cookbook Trace:\r\n           ---------------\r\n           /tmp/kitchen/cookbooks/elasticsearch/libraries/provider_plugin.rb:44:in `block (2 levels) in <class:PluginProvider>'\r\n           /tmp/kitchen/cookbooks/elasticsearch/libraries/provider_plugin.rb:27:in `block in <class:PluginProvider>'\r\n\r\n           Resource Declaration:\r\n           ---------------------\r\n           # In /tmp/kitchen/cookbooks/nd-elasticsearch/recipes/default.rb\r\n\r\n            70: elasticsearch_plugin 'royrusso/elasticsearch-HQ' do\r\n            71:   action :install\r\n            72: end\r\n\r\n           Compiled Resource:\r\n           ------------------\r\n           # Declared in /tmp/kitchen/cookbooks/nd-elasticsearch/recipes/default.rb:70:in `from_file'\r\n\r\n           elasticsearch_plugin(\"royrusso/elasticsearch-HQ\") do\r\n             action [:install]\r\n             retries 0\r\n             retry_delay 2\r\n             default_guard_interpreter :default\r\n             declared_type :elasticsearch_plugin\r\n             cookbook_name :\"nd-elasticsearch\"\r\n             recipe_name \"default\"\r\n             plugin_name \"royrusso/elasticsearch-HQ\"\r\n           end\r\n\r\n\r\n       Running handlers:\r\n       [2015-11-21T06:06:41+00:00] ERROR: Running exception handlers\r\n       Running handlers complete\r\n       [2015-11-21T06:06:41+00:00] ERROR: Exception handlers complete\r\n       Chef Client failed. 7 resources updated in 01 minutes 08 seconds\r\n       [2015-11-21T06:06:41+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out\r\n       [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'\r\n       ---- Begin output of [\"/usr/share/elasticsearch/bin/plugin\", \"install\", \"royrusso/elasticsearch-HQ\"] ----\r\n       STDOUT: -> Installing royrusso/elasticsearch-HQ...\r\n       Trying https://github.com/royrusso/elasticsearch-HQ/archive/master.zip ...\r\n       Downloading ...................................................................................................................................................................DONE\r\n       Verifying https://github.com/royrusso/elasticsearch-HQ/archive/master.zip checksums if available ...\r\n       NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)\r\n       ERROR: plugin directory /usr/share/elasticsearch/plugins/hq already exists. To update the plugin, uninstall it first using 'remove hq' command\r\n       STDERR:\r\n       ---- End output of [\"/usr/share/elasticsearch/bin/plugin\", \"install\", \"royrusso/elasticsearch-HQ\"] ----\r\n       Ran [\"/usr/share/elasticsearch/bin/plugin\", \"install\", \"royrusso/elasticsearch-HQ\"] returned 74\r\n       [2015-11-21T06:06:41+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)\r\n>>>>>> Converge failed on instance <default-ubuntu-1404>.\r\n>>>>>> Please see .kitchen/logs/default-ubuntu-1404.log for more details\r\n>>>>>> ------Exception-------\r\n>>>>>> Class: Kitchen::ActionFailed\r\n>>>>>> Message: SSH exited (1) for command: [sh -c '\r\n\r\nsudo -E /opt/chef/bin/chef-solo --config /tmp/kitchen/solo.rb --log_level auto --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json\r\n']\r\n>>>>>> ----------------------\r\n```\r\n\r\nStrangely it doesn't manifest itself with every plugin. \r\n\r\n`royrusso/elasticsearch-HQ` Always fails the second converge however `lmenezes/elasticsearch-kopf` and `mobz/elasticsearch-head` succeed. \r\n\r\nI can't find any documentation showing why HQ might not work. My theory is that maybe it doesn't support ES 2.0.0\r\n\r\n"}}