Skip to content

Elasticsearch package uninstall does not delete plugin bin directories #18109

@spinscale

Description

@spinscale

Elasticsearch version: 5.0.0-alpha2 deb/rpm

Steps to reproduce:

  1. Install elasticsearch package on any distro
  2. Install a plugin with a bin/ directory, ie x-pack
  3. Run rpm -e elasticsearch or dpkg -P elasticsearch
  4. Install the package again
  5. Install x-pack again and watch an exception because the bin/ directory is still there
/usr/share/elasticsearch/bin/elasticsearch-plugin install x-pack
-> Downloading x-pack from elastic
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.lang.RuntimePermission getClassLoader
* java.lang.RuntimePermission setContextClassLoader
* java.lang.RuntimePermission setFactory
* java.util.PropertyPermission * read,write
* javax.net.ssl.SSLPermission setHostnameVerifier
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
Exception in thread "main" java.nio.file.FileAlreadyExistsException: /usr/share/elasticsearch/bin/x-pack
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:88)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
    at java.nio.file.Files.createDirectory(Files.java:674)
    at org.elasticsearch.plugins.InstallPluginCommand.installBin(InstallPluginCommand.java:456)
    at org.elasticsearch.plugins.InstallPluginCommand.install(InstallPluginCommand.java:419)
    at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:202)
    at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:188)
    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:57)

The postrm scripts currently deletes the plugins directory on purge, but leaves the bin directory as is, thus cleans everything only half up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Delivery/PackagingRPM and deb packaging, tar and zip archives, shell and batch scripts>bugTeam:DeliveryMeta label for Delivery teamhelp wantedadoptme

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions