We are trying to Migrate ES from 6.6 to 6.7 and got the below exception on runtime.
java.lang.NoSuchFieldError: LUCENE_6_4_1
at org.elasticsearch.Version.<clinit>(Version.java:76) ~[elasticsearch-6.7.0.jar!/:6.7.0]
at org.elasticsearch.common.logging.DeprecationLogger.<clinit>(DeprecationLogger.java:144) ~[elasticsearch-6.7.0.jar!/:6.7.0]
this sounds like a problem with the installation (lucene core out of sync with elasticsearch). Which platform are you running this on and using which installation method (linux tar vs. rpm vs. docker etc.)?
You can likely check the version of the jar by using:
unzip -p lib/lucene-core-* META-INF/MANIFEST.MF | less
I think we need a slightly deeper understanding of this to come to a resolution. A few questions:
Is this a client program using the elasticsearch transport protocol or are you embedding the elasticsearch service into your program?
The exception shown above, does that occur while starting the elasticsearch server or a client program?
Not sure exactly how spring boot does class loading, but would it be possible to find out if any part of your application has another org.apache.lucene.util.Version version?
Would it be possible to share the full stack trace?
Is this a client program using the elasticsearch transport protocol or are you embedding the elasticsearch service into your program?
Yes its a client code, using elasticsearch high level REST client
The exception shown above, does that occur while starting the elasticsearch server or a client program?
We got the above exception while creating elasticsearch query using Queriesbuilder, Please note that service bootup was successful.
Not sure exactly how spring boot does class loading, but would it be possible to find out if any part of your application has another org.apache.lucene.util.Version version?
I Have plot the mvn dependency tree, I didn't get lucene-core dependency from any other source.
Would it be possible to share the full stack trace?
java.lang.NoSuchFieldError: LUCENE_6_4_1
at org.elasticsearch.Version.(Version.java:76) ~[elasticsearch-6.7.0.jar!/:6.7.0]
at org.elasticsearch.common.logging.DeprecationLogger.(DeprecationLogger.java:144) ~[elasticsearch-6.7.0.jar!/:6.7.0]
at org.elasticsearch.search.builder.SearchSourceBuilder.(SearchSourceBuilder.java:81) ~[elasticsearch-6.7.0.jar!/:6.7.0]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_92-internal]
Please note that we got above Exception when creating an object of SearchSourceBuilder.java class
def searchSourcebuilder = new SearchSourceBuilder()
public final class org.apache.lucene.util.Version {
public static final org.apache.lucene.util.Version LUCENE_6_0_0;
public static final org.apache.lucene.util.Version LUCENE_6_0_1;
public static final org.apache.lucene.util.Version LUCENE_6_1_0;
public static final org.apache.lucene.util.Version LUCENE_6_2_0;
public static final org.apache.lucene.util.Version LUCENE_6_2_1;
public static final org.apache.lucene.util.Version LUCENE_6_3_0;
public static final org.apache.lucene.util.Version LUCENE_6_4_0;
public static final org.apache.lucene.util.Version LUCENE_6_4_1;
public static final org.apache.lucene.util.Version LUCENE_6_4_2;
public static final org.apache.lucene.util.Version LUCENE_6_5_0;
public static final org.apache.lucene.util.Version LUCENE_6_5_1;
public static final org.apache.lucene.util.Version LUCENE_6_6_0;
public static final org.apache.lucene.util.Version LUCENE_6_6_1;
public static final org.apache.lucene.util.Version LUCENE_6_6_2;
public static final org.apache.lucene.util.Version LUCENE_6_6_3;
public static final org.apache.lucene.util.Version LUCENE_6_6_4;
public static final org.apache.lucene.util.Version LUCENE_6_6_5;
public static final org.apache.lucene.util.Version LUCENE_7_0_0;
public static final org.apache.lucene.util.Version LUCENE_7_0_1;
public static final org.apache.lucene.util.Version LUCENE_7_1_0;
public static final org.apache.lucene.util.Version LUCENE_7_2_0;
public static final org.apache.lucene.util.Version LUCENE_7_2_1;
public static final org.apache.lucene.util.Version LUCENE_7_3_0;
public static final org.apache.lucene.util.Version LUCENE_7_3_1;
public static final org.apache.lucene.util.Version LUCENE_7_4_0;
public static final org.apache.lucene.util.Version LUCENE_7_5_0;
public static final org.apache.lucene.util.Version LUCENE_7_6_0;
public static final org.apache.lucene.util.Version LUCENE_7_7_0;
public static final org.apache.lucene.util.Version LATEST;
public static final org.apache.lucene.util.Version LUCENE_CURRENT;
public final int major;
public final int minor;
public final int bugfix;
public final int prerelease;
static final boolean $assertionsDisabled;
public static org.apache.lucene.util.Version parse(java.lang.String) throws java.text.ParseException;
public static org.apache.lucene.util.Version parseLeniently(java.lang.String) throws java.text.ParseException;
public static org.apache.lucene.util.Version fromBits(int, int, int);
public boolean onOrAfter(org.apache.lucene.util.Version);
public java.lang.String toString();
public boolean equals(java.lang.Object);
public int hashCode();
static {};
}
that looks fine. It looks like it somehow picked up another version of org.apache.lucene.util.Version.
I think the easiest route to find the cause is to use a debugger and break inside org.elasticsearch.Version and then examine the class loader in use to find out where the class is taken from.
Alternatively, it could make sense to setup a mini-example demonstrating the issue and share it here.
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.