Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [connector-elasticsearch] Base on SeaTunnel Engine Cluster Mode, elasticsearch source is not working well #3811

Closed
2 of 3 tasks
chaorongzhi opened this issue Dec 27, 2022 · 2 comments · Fixed by #3884

Comments

@chaorongzhi
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

Base on SeaTunnel Engine Cluster Mode,I was able to run the following example with idea, then compiled and packaged it and ran it with an error.

SeaTunnel Version

dev

SeaTunnel Config

env {
  execution.parallelism = 1
  job.mode = "BATCH"
}

source {
    Elasticsearch {
        hosts = ["http://localhost:9200"]
        index = "index1"
        schema = {
          fields {
            title = string
            category = string
            price = int
          }
        }
    }
}

transform {
}

sink {
   Console{}
}

Running Command

./bin/seatunnel.sh --config ./config/es2es.conf

Error Exception

2022-12-27 19:44:26,888 INFO  org.apache.seatunnel.engine.server.TaskExecutionService - [localhost]:5801 [seatunnel_default_cluster] [5.1] Task TaskGroupLocation{jobId=660085528888082433, pipelineId=1, taskGroupId=30000} complete with state FAILED
2022-12-27 19:44:26,889 INFO  org.apache.seatunnel.engine.server.dag.physical.PhysicalVertex - Job SeaTunnel (660085528888082433), Pipeline: [(1/1)], task: [Elasticsearch-SourceTask (1/1)] turn to end state FAILED.
2022-12-27 19:44:26,889 ERROR org.apache.seatunnel.engine.server.dag.physical.PhysicalVertex - Job SeaTunnel (660085528888082433), Pipeline: [(1/1)], task: [Elasticsearch-SourceTask (1/1)] end with state FAILED and Exception: java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.seatunnel.common.utils.JsonUtils.parseObject(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/node/ObjectNode;" the class loader (instance of org/apache/seatunnel/engine/common/loader/SeatunnelChildFirstClassLoader) of the current class, org/apache/seatunnel/connectors/seatunnel/elasticsearch/client/EsRestClient, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, org/apache/seatunnel/common/utils/JsonUtils, have different Class objects for the type com/fasterxml/jackson/databind/node/ObjectNode used in the signature
        at org.apache.seatunnel.connectors.seatunnel.elasticsearch.client.EsRestClient.getDocsFromScrollRequest(EsRestClient.java:204)
        at org.apache.seatunnel.connectors.seatunnel.elasticsearch.client.EsRestClient.searchByScroll(EsRestClient.java:175)
        at org.apache.seatunnel.connectors.seatunnel.elasticsearch.source.ElasticsearchSourceReader.pollNext(ElasticsearchSourceReader.java:80)
        at org.apache.seatunnel.engine.server.task.flow.SourceFlowLifeCycle.collect(SourceFlowLifeCycle.java:115)
        at org.apache.seatunnel.engine.server.task.SourceSeaTunnelTask.collect(SourceSeaTunnelTask.java:68)
        at org.apache.seatunnel.engine.server.task.SeaTunnelTask.stateProcess(SeaTunnelTask.java:157)
        at org.apache.seatunnel.engine.server.task.SourceSeaTunnelTask.call(SourceSeaTunnelTask.java:74)
        at org.apache.seatunnel.engine.server.TaskExecutionService$BlockingWorker.run(TaskExecutionService.java:357)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)

2022-12-27 19:44:26,890 ERROR org.apache.seatunnel.engine.server.dag.physical.SubPlan - Task TaskGroupLocation{jobId=660085528888082433, pipelineId=1, taskGroupId=30000} Failed in Job SeaTunnel (660085528888082433), Pipeline: [(1/1)], Begin to cancel other tasks in this pipeline.

Flink or Spark Version

No response

Java or Scala Version

No response

Screenshots

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@Hisoka-X
Copy link
Member

This is a bug only appear on seatunnel engine. Cause our seatunnel common use jackson as dependency, and JsonUtils and ObjectNode will be parent classloader loaded (which AppClassloader), also cause es connector use jackson as dependency, so ObjectNode will load use childfirst classloader(which SeaTunnelChildFirstClassloader). The different classloader make this bug happend.
I think we should add jackson into alway parentfirst loader list in SeatunnelChildFirstClassLoader::DEFAULT_PARENT_FIRST_PATTERNS. Also support use seatunnel.yaml change DEFAULT_PARENT_FIRST_PATTERNS.

@Carl-Zhou-CN
Copy link
Member

I want to try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment