License 2.1.1 Jar Hell Error

Following is the error I am seeing on my nodes :

[2016-03-17 17:37:22,708][ERROR][bootstrap ] Exception
java.lang.IllegalStateException: failed to load bundle [file:/D:/ElasticSearch/pluginVersioned/license/2.2.1/license-2.2.1.jar, file:/D:/ElasticSearch/pluginVersioned/license/2.2.1/license-core-2.2.1.jar, file:/D:/ElasticSearch/pluginVersioned/license/2.2.1/license-plugin-api-2.2.1.jar, file:/D:/ElasticSearch/pluginVersioned/marvel-agent/2.2.1/marvel-agent-2.2.1.jar] due to jar hell
at org.elasticsearch.plugins.PluginsService.loadBundles(
at org.elasticsearch.plugins.PluginsService.(
at org.elasticsearch.node.Node.(
at org.elasticsearch.node.Node.(
at org.elasticsearch.bootstrap.Bootstrap.setup(
at org.elasticsearch.bootstrap.Bootstrap.init(
at org.elasticsearch.bootstrap.Elasticsearch.main(
Caused by: access denied ("" "D:\ElasticSearch\pluginVersioned\license\2.2.1\license-2.2.1.jar" "read")
at java.lang.SecurityManager.checkPermission(
at java.lang.SecurityManager.checkRead(
at java.util.jar.JarFile.(
at java.util.jar.JarFile.(
at org.elasticsearch.bootstrap.JarHell.checkJarHell(
at org.elasticsearch.plugins.PluginsService.loadBundles(
... 7 more

I don't want to disable the Java Security Manager. I have added a plugin-security.policy file in the License plugin folder next to the jars. Here's what the file looks like :

grant {
// needed to set expert SSL options, etc
permission java.lang.RuntimePermission "setFactory";
permission "setHostnameVerifier";
permission "*";

Even then I get the above error.

How did you install Elasticsearch? Did you change anything from the default configuration?

I don't recognize the folder "pluginVersioned" - is that something you created?

Please do not change or add to the contents of the plugin directory - it is not necessary, and we need to figure out what the real problem is.

elasticsearch is installed using offline method ... i.e. download it, change the yml file, and point elasticsearch to that yml file using the config parameter.

The only change I made was the bin/elasticsearch.bat file to add another argument for picking the config from another location.

pluginVersioned is another folder where I store all my plugins and initializing from there. There is no other plugin directory.

Can you try this in a fresh install, with default settings and directories? It sounds like you made a lot of changes to the configuration, and they are clearly the cause of the issue.

Are you installing the plugin using bin/plugin?

Fresh install works fine when the plugins are directly under the plugins folder next to bin folder. The problem is when using the path.plugins parameter in elasticsearch.yml file point to a different location. Additional complication in my case was that the plugins folder was symlinked.

Since the path.plugins parameter is still supported, can I get an example of how to setup the java security policy in the plugin folders if the folders are not under the elasticsearch folder ?

IIRC we don't support symlinks for some dirs (if not all) so it's probably the issue here.

Can you explain your use-case for needing to specify path.plugins?

symlinks definitely worked before 2.0.0 .. we have been using it ... did it change after > 2.0.0 ?

We have a separate folder structure where we have all of our plugins for each version. Similarly for elasticsearch and kibana. Then we have a deployment solution which allows us to deploy the desired versions of elasticsearch and kibana along with desired plugins by simply symlinking them under one folder and then using path.plugins. This allows us to deploy different configurations on different environments.

However, now, marvel and license strictly have to be of the same version as elasticsearch. This slightly makes things simpler, coz there is no way to configure different versions of these plugins for elasticsearch. Hence, I directly pushed these plugins under the elasticsearch plugins folder. But this doesn't allow me now to "not deploy" the plugins in another environment. And for other plugins which may not have strict requirements as marvel and license, this problem still stands.

Yes it did.