Giter Site home page Giter Site logo

Comments (5)

fernandoabcampos avatar fernandoabcampos commented on July 18, 2024 1

Hi, @lbh375441316
Did you manage to solve this issue?
Thanks,

from kafka-connect-elasticsearch.

ewencp avatar ewencp commented on July 18, 2024

Hard to say what the issue is since this this is coming from the underlying library and indicates that ES is returning an invalid JSON response. Are there any other messages in the log before the exception? Without more info about what is being returned in the request it'll be hard to get to the root cause.

from kafka-connect-elasticsearch.

chaokunyang avatar chaokunyang commented on July 18, 2024

I had the same problem. It is the problem of jest client version and es version in my project. Jest client used in connector is 2.0.0, it doesn't support es 5.x, ex: create index in ex5.x use put not post. So I can't get more info about what is being returned in the request, because jest directly parse the reponse and don't catch not checked exception:
io.searchbox.action.AbstractAction#parseResponseBody(line 98)

 protected JsonObject parseResponseBody(String responseBody) {
        if (responseBody == null || responseBody.trim().isEmpty()) {
            return new JsonObject();
        }

        JsonElement parsed = new JsonParser().parse(responseBody);
        if (parsed.isJsonObject()) {
            return parsed.getAsJsonObject();
        } else {
            throw new JsonSyntaxException("Response did not contain a JSON Object");
        }
    }

if parse like this,there will be more logs:

        JsonElement parsed;
        try {
            parsed  = new JsonParser().parse(responseBody);
        }catch (JsonSyntaxException e) {
            throw new RuntimeException("Can't parse response[" + responseBody + "]", e);
        }

from kafka-connect-elasticsearch.

novakov-alexey-zz avatar novakov-alexey-zz commented on July 18, 2024

I had similar issue a couple of month ago when moving to new ES version. Try to use
jestVersion = "2.4.0"
"io.searchbox" % "jest" % jestVersion

from kafka-connect-elasticsearch.

levzem avatar levzem commented on July 18, 2024

closing because connector runs on newer jest version now

from kafka-connect-elasticsearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.