Upgrading from 5.6.0 -> 5.6.6 ES not starting up (even after updating the SG jar files)

Hi

I am trying to upgrade ES from 5.6.0 to 5.6.6, and following the instructions online, i did the following:

Using the dev tools

PUT /_cluster/settings

{

“transient” : {

“cluster.routing.allocation.enable” : “none”

}

}

Stopped elasticsearch

Downloaded ES 5.6, and extracted it to a temp folder. Then renamed the bin & lib folder of the 5.6.0 instance. Copied the bin & lib folders form the 5.6.6 folder i extracted. Moved out the following files and downloaded the 5.6.6 version

search-guard-5-5.6.0-16.jar

search-guard-ssl-5.6.0-23.jar

transport-netty4-client-5.6.0.jar

Starrted ES - getting the following error.

[2018-01-22T21:30:07,219][ERROR][o.e.b.Bootstrap ] Exception

java.lang.IllegalArgumentException: plugin [search-guard-5] is incompatible with version [5.6.6]; was designed for version [5.6.0]

at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:146) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Spawner.spawnNativePluginControllers(Spawner.java:80) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:168) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.6.6.jar:5.6.6]

So i moved aside the plugins/search-guard-5 folder and installed the plugin from scratch - ./elasticsearch-plugin install -b com.floragunn:search-guard-5:5.6.6-18

But now i am getting the following error when trying to start ES.

[2018-01-22T21:34:18,387][ERROR][o.e.b.Bootstrap ] Exception

java.lang.StringIndexOutOfBoundsException: String index out of range: -1

at java.lang.String.substring(String.java:1967) ~[?:1.8.0_144]

at org.elasticsearch.bootstrap.Security.readPolicy(Security.java:220) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Security.getPluginPermissions(Security.java:177) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Security.configure(Security.java:119) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:228) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.6.6.jar:5.6.6]

[2018-01-22T21:34:18,406][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]

org.elasticsearch.bootstrap.StartupException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.6.jar:5.6.6]

Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

at java.lang.String.substring(String.java:1967) ~[?:1.8.0_144]

at org.elasticsearch.bootstrap.Security.readPolicy(Security.java:220) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Security.getPluginPermissions(Security.java:177) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Security.configure(Security.java:119) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:228) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.6.jar:5.6.6]

… 6 more

Can anyone point me to where i could be going wrong?

Thanks, appreciate it.

That is not a proper way to upgrade an Elasticsearch installation, I think the installation as it is is simply messed up.

To upgrade an ES node, follow the steps here:

Basically you need to download and install the new version of Elasticsearch, install the SG plugin with the bin/elasticsearch-plugin command, and copy your elasticsearch.yml from the old version to the new version. If you made changes in other files like log4j4.properties, copy those as well.

Since the SG configuration is kept in an ES index, there is no need to re-apply any SG configuration settings after the upgrade.

···

On Monday, January 22, 2018 at 10:42:47 PM UTC+1, Paul Azad wrote:

Hi

I am trying to upgrade ES from 5.6.0 to 5.6.6, and following the instructions online, i did the following:

Using the dev tools

PUT /_cluster/settings

{

“transient” : {

“cluster.routing.allocation.enable” : “none”

}

}

Stopped elasticsearch

Downloaded ES 5.6, and extracted it to a temp folder. Then renamed the bin & lib folder of the 5.6.0 instance. Copied the bin & lib folders form the 5.6.6 folder i extracted. Moved out the following files and downloaded the 5.6.6 version

search-guard-5-5.6.0-16.jar

search-guard-ssl-5.6.0-23.jar

transport-netty4-client-5.6.0.jar

Starrted ES - getting the following error.

[2018-01-22T21:30:07,219][ERROR][o.e.b.Bootstrap ] Exception

java.lang.IllegalArgumentException: plugin [search-guard-5] is incompatible with version [5.6.6]; was designed for version [5.6.0]

at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:146) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Spawner.spawnNativePluginControllers(Spawner.java:80) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:168) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.6.6.jar:5.6.6]

So i moved aside the plugins/search-guard-5 folder and installed the plugin from scratch - ./elasticsearch-plugin install -b com.floragunn:search-guard-5:5.6.6-18

But now i am getting the following error when trying to start ES.

[2018-01-22T21:34:18,387][ERROR][o.e.b.Bootstrap ] Exception

java.lang.StringIndexOutOfBoundsException: String index out of range: -1

at java.lang.String.substring(String.java:1967) ~[?:1.8.0_144]

at org.elasticsearch.bootstrap.Security.readPolicy(Security.java:220) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Security.getPluginPermissions(Security.java:177) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Security.configure(Security.java:119) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:228) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.6.6.jar:5.6.6]

[2018-01-22T21:34:18,406][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]

org.elasticsearch.bootstrap.StartupException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.6.jar:5.6.6]

Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

at java.lang.String.substring(String.java:1967) ~[?:1.8.0_144]

at org.elasticsearch.bootstrap.Security.readPolicy(Security.java:220) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Security.getPluginPermissions(Security.java:177) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Security.configure(Security.java:119) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:228) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.6.jar:5.6.6]

at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.6.jar:5.6.6]

… 6 more

Can anyone point me to where i could be going wrong?

Thanks, appreciate it.

StringIndexOutOfBoundsException error is realted to Java substring and it means you are attempting to access a character which would come after the end of the string. If a String is only 4 characters long, attempting to get the substring from index 0 - 8, will throw this exception. substring(beginIndex, endInded) throws IndexOutOfBoundsException if the beginIndex is negative, or endIndex is larger than the length of this String object, or beginIndex is larger than endIndex.