0

As topic states, I have a problem while trying to install search-guard plugin for my ELK stack:

[XXX@XXXX bin]$ ./elasticsearch-plugin install -b file:///home/xxxx/search-guard-6-6.2.1-21.0.zip
-> Downloading file:///home/xxxx/search-guard-6-6.2.1-21.0.zip
[=================================================] 100%  
ERROR: `elasticsearch` directory is missing in the plugin zip

I tried to do it from custom directory, then, following this answer from home, but it did not help. When I unzip the archive, I can see that there is a directory called "elasticsearch" there:

Does anyone have any suggestions how to proceed with that?

Geshode
  • 3,600
  • 6
  • 18
  • 32
baczko
  • 33
  • 1
  • 7

1 Answers1

0

The error comes from InstallPluginCommand.class within the lib\plugin-cli-x.x.x.jar and is exactly what is says. Here's a clipped portion of the code as it's reading thru the entries in the zip file:

ZipInputStream zipInput = new ZipInputStream(Files.newInputStream(zip));

try {
    ZipEntry entry;
    while((entry = zipInput.getNextEntry()) != null) {
        if (entry.getName().startsWith("elasticsearch/")) {
            hasEsDir = true;
            ...
    }

}

if (!hasEsDir) {
    throw new UserException(2, "`elasticsearch` directory is missing in the plugin zip");
}

I realize that doesn't help you much, but as a last ditch effort, if you can't get to the root cause of the issue, 1 thing I did to get me over the hurdle was to just copy the files from the zip file into the es plugins directory (/usr/share/elasticsearch/plugins in our case). They go within /plugins, but under a directory, which is the name that Elasticsearch knows the plugin by.

The only 2 gotchas are:

  1. You need to know the directory name to create under /plugins.
  2. You need to know the replacement values for the plugin-descriptor.properties file.

If you can get that far, you can start ES and it should load everything fine.

Rick Gagne
  • 152
  • 1
  • 1
  • 10