Unable to install X-Pack

I am unable to install X-Pack. Initially, I ran the command to remove x-pack without being the super-user for which it gave the following error:-

-> Removing x-pack...
Exception in thread "main" java.io.IOException: Could not remove the following files (in the order of attempts):
   /home/yuvraj/Downloads/ElasticStack5.0/Alpha4/elasticsearch-5.0.0-alpha4/bin/x-pack/syskeygen: java.nio.file.AccessDeniedException: /home/yuvraj/Downloads/ElasticStack5.0/Alpha4/elasticsearch-5.0.0-alpha4/bin/x-pack/syskeygen
   /home/yuvraj/Downloads/ElasticStack5.0/Alpha4/elasticsearch-5.0.0-alpha4/bin/x-pack/croneval: java.nio.file.AccessDeniedException: /home/yuvraj/Downloads/ElasticStack5.0/Alpha4/elasticsearch-5.0.0-alpha4/bin/x-pack/croneval

at org.apache.lucene.util.IOUtils.rm(IOUtils.java:323)
at org.elasticsearch.plugins.RemovePluginCommand.execute(RemovePluginCommand.java:93)
at org.elasticsearch.plugins.RemovePluginCommand.execute(RemovePluginCommand.java:63)
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:91)
at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:69)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:91)
at org.elasticsearch.cli.Command.main(Command.java:53)
at org.elasticsearch.plugins.PluginCli.main(PluginCli.java:61)

Then after running the following query:-
sudo bin/elasticsearch-plugin remove x-pack

It gives the following error:

[sudo] password for yuvraj:
-> Removing x-pack...
A tool for managing installed elasticsearch plugins

Commands

list - Lists installed elasticsearch plugins
install - Install a plugin
remove - Removes a plugin from elasticsearch

Non-option arguments:
command

Option Description


-h, --help show help
-s, --silent show minimal output
-v, --verbose show verbose output
ERROR: plugin x-pack not found; run 'elasticsearch-plugin list' to get list of installed plugins

After running the command as mentioned i.e. bin/elasticsearch-plugin list, it shows as below:-

bin/elasticsearch-plugin list
.removing-x-pack

I am unsure whether X-Pack has been uninstalled or not?

However, I am not seeing such behaviour in Kibana for X-Pack Uninstallation. Uninstalling X-Pack on Kibana without being the super-user:-

bin/kibana-plugin remove x-pack
Removing x-pack...
Unable to remove plugin because of error: "EACCES: permission denied, unlink '/home/yuvraj/Downloads/ElasticStack5.0/Alpha4/kibana-5.0.0-alpha4-linux-x64/installedPlugins/x-pack/.node-version'"

bin/kibana-plugin list
x-pack@5.0.0-alpha4-SNAPSHOT

sudo bin/kibana-plugin remove x-pack
Removing x-pack...

Hi Yuvraj,

Thanks for trying out 5.0 alpha 4.

In order to verify if X-Pack has been properly uninstalled, simply navigate to the file directory under where your Elasticsearch 5.0 alpha 4 installed and go into /plugins directory. If you don't see /x-pack directory inside the /plugins directory, then you have successfully uninstalled X-Pack.

In other words,

your_home_directory/elasticsearch-5.0.0-alpha4/plugins/
(no xpack directory when uninstalled)
your_home_directory/elasticsearch-5.0.0-alpha4/plugins/xpack (when installed)

Hope this helps,
Bohyun

Thanks for the reply.

Can we change the behaviour when a user tries to remove X-Pack without having root privileges to throw an error stating "Kindly login with root privileges to remove X-Pack".

It will help the user to understand easily.

Without having root privileges and removing X-Pack gives an error and at the same time there is no xpack directory which indicates X-Pack may have been removed is quite misleading to the user.

Hi Yuvraj -

Thanks for your feedback. We've created an issue to improve the error and log messages when uninstalling X-Pack.

Cheers,
Bohyun

Thanks for the acknowledgement.

Can you please send me the ticket link so that I am aware of this change.

Thanks,
Yuvraj