I am trying to upgrade my service from Elasticsearch 1.4 to Elasticsearch 5.4.1. It run without issues on Centos 6.8, but after the upgrade I am getting the following error:
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.elasticsearch.common.logging.DeprecationLogger.(DeprecationLogger.java:138)
at org.elasticsearch.common.xcontent.support.AbstractXContentParser.(AbstractXContentParser.java:57)
at org.elasticsearch.common.xcontent.json.JsonXContentParser.(JsonXContentParser.java:44)
at org.elasticsearch.common.xcontent.json.JsonXContent.createParser(JsonXContent.java:103)
at org.elasticsearch.common.settings.Setting.parseableStringToList(Setting.java:848)
at org.elasticsearch.common.settings.Setting.lambda$listSetting$27(Setting.java:802)
at org.elasticsearch.common.settings.Setting.listSetting(Setting.java:807)
at org.elasticsearch.common.settings.Setting.listSetting(Setting.java:802)
at org.elasticsearch.common.network.NetworkService.(NetworkService.java:50)
at org.elasticsearch.client.transport.TransportClient.newPluginService(TransportClient.java:98)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:126)
at org.elasticsearch.client.transport.TransportClient.(TransportClient.java:268)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:127)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:113)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:103)
...
Caused by: java.lang.NullPointerException
at org.elasticsearch.Build.(Build.java:51)
... 24 more
There has been a thread about this issue already, but apparently it has been resolved: ES 5.3 and Java-API 5.3.0 > java.lang.NullPointerException? in Elasticsearch 5.3. However, I am still seeing that issue the the latest version (5.4.1 and 5.4.0).
To complement the information on this issue, we found that:
Returns a JarInputStream with man = null (and most of the other properties are null) possibly because is not being able to read the MANIFEST file.
To verify that there was a Manifest file we manually uncompress the elasticsearch-5.4.1.jar file and the file seems to be correct.
Any ideas what can cause this behaviour?
If it helps:
OS: Centos 6.8
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
val s = Settings.builder()
.put("cluster.name", clusterName)
.build()
val client = new PreBuiltTransportClient(s)
nodes.asScala.foreach { node =>
client.addTransportAddress(new InetSocketTransportAddress(node))
}
The exception occurs on the instantiation of the PreBuiltTransportClient
We found that our elasticsearch-5.4.1.jar has a different sha1 hash from the one published on maven central.
We are investigating this issue, but I believe this is the reason why it cannot read the manifest file.
@jasontedor we are using the official distribution of Elasticsearch.
After more investigation we found that the issue was in our CI system at build time when it create rpms for our Scala services.
Apparently there is some jar repackaging happening on Centos that changes the sha1 sums of the jar files and in the case of elasticsearch-5.4.1.jar when you try to instantiate a PreBuiltTransportClient it does some validation using the MANIFEST file and this was failing because of the different sha1sum.
To fix this we had to explicit remove the repackaging in the spec files generated by sbt and maven.
I'm glad you've found the issue. I want to be clear about something for others that are following this thread. A repackaged distribution is not an official distribution, and we do not support repackaged distributions.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.