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

Permission problem when installing Watcher or Shield #423

Closed
karmi opened this issue Jan 8, 2016 · 5 comments
Closed

Permission problem when installing Watcher or Shield #423

karmi opened this issue Jan 8, 2016 · 5 comments
Labels
Bug Something isn't working

Comments

@karmi
Copy link
Contributor

karmi commented Jan 8, 2016

It seems like we have a permissions problem when installing plugins (such as Shield and Watcher) which have their own binaries and try to copy them to a different location, an error looks like this:

ERROR: Could not move [/usr/share/elasticsearch/plugins/watcher/bin] to [/usr/share/elasticsearch/bin/watcher]

I'm wondering what we can actually do here? Should we ensure that the directory has the same user:group as defined in es_user.username and es_user.groupname?

I can see that we're discussing a similar issue in #405.

Full output from the Chef run:

* elasticsearch_plugin[watcher] action install 

================================================================================ 
Error executing action `install` on resource 'elasticsearch_plugin[watcher]' 
================================================================================ 

Mixlib::ShellOut::ShellCommandFailed 
------------------------------------ 
Expected process to exit with [0], but received '74' 
---- Begin output of ["/usr/share/elasticsearch/bin/plugin", "install", "watcher"] ---- 
STDOUT: -> Installing watcher... 
Trying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/watcher/2.1.0/watcher-2.1.0.zip ... 
Downloading ..................................................................................................DONE 
Verifying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/watcher/2.1.0/watcher-2.1.0.zip checksums if available ... 
Downloading .DONE 
Installed watcher into /usr/share/elasticsearch/plugins/watcher 
ERROR: Error copying bin directory [/usr/share/elasticsearch/plugins/watcher/bin] to [/usr/share/elasticsearch/bin/watcher], cleaning up, reason: IOException[Could not move [/usr/share/elasticsearch/plugins/watcher/bin] to [/usr/share/elasticsearch/bin/watcher]]; nested: AccessDeniedException[/usr/share/elasticsearch/plugins/watcher/bin -> /usr/share/elasticsearch/bin/watcher]; 
ERROR: Could not move [/usr/share/elasticsearch/plugins/watcher/bin] to [/usr/share/elasticsearch/bin/watcher] 
STDERR: 
---- End output of ["/usr/share/elasticsearch/bin/plugin", "install", "watcher"] ---- 
Ran ["/usr/share/elasticsearch/bin/plugin", "install", "watcher"] returned 74 

Cookbook Trace: 
--------------- 
/var/chef/cache/cookbooks/elasticsearch/libraries/provider_plugin.rb:43:in `block in <class:PluginProvider>' 

Resource Declaration: 
--------------------- 
# In /var/chef/cache/cookbooks/elasticsearch-chef/recipes/msp-lab.rb 

60: elasticsearch_plugin 'watcher' do 
61: action :install 
62: end 
63: 

Compiled Resource: 
------------------ 
# Declared in /var/chef/cache/cookbooks/elasticsearch-chef/recipes/msp-lab.rb:60:in `from_file' 

elasticsearch_plugin("watcher") do 
action [:install] 
retries 0 
retry_delay 2 
default_guard_interpreter :default 
declared_type :elasticsearch_plugin 
cookbook_name "elasticsearch-chef" 
recipe_name "msp-lab" 
plugin_name "watcher" 
url "watcher" 
end 
Running handlers: 
[2016-01-04T12:12:46-05:00] ERROR: Running exception handlers 
Running handlers complete 
[2016-01-04T12:12:46-05:00] ERROR: Exception handlers complete 
Chef Client failed. 1 resources updated in 14 seconds 
[2016-01-04T12:12:47-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out 
[2016-01-04T12:12:47-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report 
[2016-01-04T12:12:47-05:00] ERROR: elasticsearch_plugin[watcher] (elasticsearch-chef::msp-lab line 60) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '74' 
---- Begin output of ["/usr/share/elasticsearch/bin/plugin", "install", "watcher"] ---- 
STDOUT: -> Installing watcher... 
Trying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/watcher/2.1.0/watcher-2.1.0.zip ... 
Downloading ..................................................................................................DONE 
Verifying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/watcher/2.1.0/watcher-2.1.0.zip checksums if available ... 
Downloading .DONE 
Installed watcher into /usr/share/elasticsearch/plugins/watcher 
ERROR: Error copying bin directory [/usr/share/elasticsearch/plugins/watcher/bin] to [/usr/share/elasticsearch/bin/watcher], cleaning up, reason: IOException[Could not move [/usr/share/elasticsearch/plugins/watcher/bin] to [/usr/share/elasticsearch/bin/watcher]]; nested: AccessDeniedException[/usr/share/elasticsearch/plugins/watcher/bin -> /usr/share/elasticsearch/bin/watcher]; 
ERROR: Could not move [/usr/share/elasticsearch/plugins/watcher/bin] to [/usr/share/elasticsearch/bin/watcher] 
STDERR: 
---- End output of ["/usr/share/elasticsearch/bin/plugin", "install", "watcher"] ---- 
Ran ["/usr/share/elasticsearch/bin/plugin", "install", "watcher"] returned 74 
[2016-01-04T12:12:47-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

UPDATE: I'm asking the original reporter to provide a Chef version and the cookbook version.

@martinb3
Copy link
Contributor

martinb3 commented Jan 8, 2016

I believe I just fixed this in #421. :)

@martinb3
Copy link
Contributor

martinb3 commented Jan 8, 2016

Commented on #405 as well to ask them to test the changes 👍

@karmi
Copy link
Contributor Author

karmi commented Jan 8, 2016

@martinb3 Argh, you can clearly see my ADHD-like mental state... I even saw the issue from Radek in the e-mail...

@martinb3
Copy link
Contributor

martinb3 commented Jan 8, 2016

All good! I just pushed the changes as you made the issue @karmi 😃

@martinb3 martinb3 added the Bug Something isn't working label Jan 8, 2016
@martinb3
Copy link
Contributor

martinb3 commented Jan 8, 2016

I've released v2.1.1 with a fix for this issue. Let me know if you hear of any other breakages with these two plugins. Thanks!

@martinb3 martinb3 closed this as completed Jan 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants