After Migrating from ES 6.6 to 6.7 getting below runtime error

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]
1 Like

Hi @Yashpal_Singh,

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

in addition to just looking at the filename.

Hi Henning,

Thanks for quick response, We are running our spring-boot project on Ubuntu OS.

Maven Dependency:

  <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>6.6.0</version>
    </dependency>

Have plot the maven dependency tree, checked the version of Lucene and it seems correct.
org.apache.lucene:lucene-core:jar:7.7.0

Your previous post indicated you are migrating to ES 6.7, why are you depending on 6.6.0 ?

Hi Tim,

My bad, Have pasted the old dependency.

Updated dependency.

 <dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>6.7.0</version>
</dependency>

Hi @Yashpal_Singh,

I think we need a slightly deeper understanding of this to come to a resolution. A few questions:

  1. Is this a client program using the elasticsearch transport protocol or are you embedding the elasticsearch service into your program?
  2. The exception shown above, does that occur while starting the elasticsearch server or a client program?
  3. 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?
  4. Would it be possible to share the full stack trace?

@HenningAndersen Please find my reply inline.

  1. 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

  1. 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.

  1. 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.

  1. 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()

Hi @Yashpal_Singh,

let us try to double check that the actual lucene jar in use has that field, using:

javap -cp lucene-core-7.7.0.jar org.apache.lucene.util.Version

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 {};
}

Hi @Yashpal_Singh,

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.

Hi Henning,

Thanks for the help, will try to dig deeper in our applicaiton dependencies :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.