Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin install does not work #382

Closed
runningman84 opened this issue Oct 6, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@runningman84
Copy link

commented Oct 6, 2015

I looks like the plugin command does not work if the elasticsearch folder is owned by root (which is the default).

         * service[elasticsearch] action nothing (skipped due to action :nothing)
         * elasticsearch_plugin[mobz/elasticsearch-head] action install[2015-10-06T11:53:32+00:00] WARN: Class Chef::Provider::ElasticsearchPlugin does not declare 'resource_name :elasticsearch_plugin'.
       [2015-10-06T11:53:32+00:00] WARN: This will no longer work in Chef 13: you must use 'resource_name' to provide DSL.


           ================================================================================
           Error executing action `install` on resource 'elasticsearch_plugin[mobz/elasticsearch-head]'
           ================================================================================

           Mixlib::ShellOut::ShellCommandFailed
           ------------------------------------
           Expected process to exit with [0], but received '74'
           ---- Begin output of ["/usr/local/bin/plugin", "-install", "mobz/elasticsearch-head"] ----
           STDOUT: -> Installing mobz/elasticsearch-head...
           Failed to install mobz/elasticsearch-head, reason: plugin directory /usr/local/elasticsearch-1.7.2/plugins is read only
           STDERR: 
           ---- End output of ["/usr/local/bin/plugin", "-install", "mobz/elasticsearch-head"] ----
           Ran ["/usr/local/bin/plugin", "-install", "mobz/elasticsearch-head"] returned 74

           Cookbook Trace:
           ---------------
           /tmp/kitchen/cache/cookbooks/elasticsearch/libraries/provider_plugin.rb:26:in `block (2 levels) in <class:ElasticsearchPlugin>'
           /tmp/kitchen/cache/cookbooks/elasticsearch/libraries/provider_plugin.rb:14:in `block in <class:ElasticsearchPlugin>'

           Resource Declaration:
           ---------------------
       # In /tmp/kitchen/cache/cookbooks/asy-graylog2/recipes/elasticsearch.rb

            39: elasticsearch_plugin 'mobz/elasticsearch-head'

           Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/asy-graylog2/recipes/elasticsearch.rb:39:in `from_file'

           elasticsearch_plugin("mobz/elasticsearch-head") do
         action [:install]
             retries 0
         retry_delay 2
             default_guard_interpreter :default
             declared_type :elasticsearch_plugin
             cookbook_name "asy-graylog2"
             recipe_name "elasticsearch"
             plugin_name "mobz/elasticsearch-head"
             plugin_dir "/usr/local/elasticsearch/plugins"
             bindir "/usr/local/bin"
         user "elasticsearch"
             group "elasticsearch"               
@martinb3

This comment has been minimized.

Copy link
Contributor

commented Oct 6, 2015

Hi -- we're actually testing this very thing in our test suites, and we're passing correct the user and group to the Chef resource which extracts the files.

Could you tell me if you're using the latest version? I know there was some issues with this previously, that have been fixed for at least a few weeks now.

Thanks!

@erulabs

This comment has been minimized.

Copy link

commented Oct 15, 2015

Well, this line is just wrong:

https://github.com/elastic/cookbook-elasticsearch/blob/master/libraries/provider_plugin.rb#L26

-install is not correct,

shell_out!("#{new_resource.bindir}/plugin -install #{name}#{version}#{url}".split(' '), user: new_resource.user, group: new_resource.group)

It should be:

shell_out!("#{new_resource.bindir}/plugin install #{name}#{version}#{url}".split(' '), user: new_resource.user, group: new_resource.group)

("-install" is not a valid param of "plugin")

P.S. Hi Martin :)

@martinb3 martinb3 self-assigned this Oct 16, 2015

@martinb3 martinb3 added this to the 2.0.0 release milestone Oct 16, 2015

@martinb3 martinb3 added the ready label Oct 20, 2015

@martinb3

This comment has been minimized.

Copy link
Contributor

commented Oct 21, 2015

Hi @runningman84 and @erulabs -- could you try the 2.0.0_wip branch of this cookbook? It should have some fixes for the installation issue; it's our goal to release a 2.0.0 version that works with ES 2.0.0. It does have some changes from the current version, but depending on how complex your resource usage is, you may or may not be affected. Thanks!

@martinb3 martinb3 closed this in dc77bc5 Nov 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.