Netflix / conductor-community

Apache License 2.0
61 stars 72 forks source link

[QUESTION]: 3.13.6 Issue with Elasticsearch 7 #216

Closed dcore94 closed 1 year ago

dcore94 commented 1 year ago

Hi all, I built the latest code and package it into a docker stack together with postgres 14 and Elasticsearch 7.6.2. When index disabled it works smoothly. When index is enabled I get the following error:

org.elasticsearch.client.ResponseException: method [PUT], host [http://es:9200], URI [/conductor_task], status line [HTTP/1.1 400 Bad Request]
conductor_conductor-server.1.jcdqx3h22227@ontheroad-3    | {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters:  [task : {properties={scheduledTime={format=strict_date_optional_time||epoch_millis, type=date}, updateTime={format=strict_date_optional_time||epoch_millis, type=date}, executionTime={type=long}, output={index=true, type=text}, input={index=true, type=text}, taskType={index=true, type=keyword}, reasonForIncompletion={index=true, type=keyword}, domain={index=true, type=keyword}, queueWaitTime={type=long}, taskDefName={index=true, type=keyword}, correlationId={index=true, type=keyword}, startTime={format=strict_date_optional_time||epoch_millis, type=date}, workflowType={index=true, type=keyword}, endTime={format=strict_date_optional_time||epoch_millis, type=date}, taskId={index=true, type=keyword}, workflowId={index=true, type=keyword}, status={index=true, type=keyword}}}]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [task : {properties={scheduledTime={format=strict_date_optional_time||epoch_millis, type=date}, updateTime={format=strict_date_optional_time||epoch_millis, type=date}, executionTime={type=long}, output={index=true, type=text}, input={index=true, type=text}, taskType={index=true, type=keyword}, reasonForIncompletion={index=true, type=keyword}, domain={index=true, type=keyword}, queueWaitTime={type=long}, taskDefName={index=true, type=keyword}, correlationId={index=true, type=keyword}, startTime={format=strict_date_optional_time||epoch_millis, type=date}, workflowType={index=true, type=keyword}, endTime={format=strict_date_optional_time||epoch_millis, type=date}, taskId={index=true, type=keyword}, workflowId={index=true, type=keyword}, status={index=true, type=keyword}}}]","caused_by":{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters:  [task : {properties={scheduledTime={format=strict_date_optional_time||epoch_millis, type=date}, updateTime={format=strict_date_optional_time||epoch_millis, type=date}, executionTime={type=long}, output={index=true, type=text}, input={index=true, type=text}, taskType={index=true, type=keyword}, reasonForIncompletion={index=true, type=keyword}, domain={index=true, type=keyword}, queueWaitTime={type=long}, taskDefName={index=true, type=keyword}, correlationId={index=true, type=keyword}, startTime={format=strict_date_optional_time||epoch_millis, type=date}, workflowType={index=true, type=keyword}, endTime={format=strict_date_optional_time||epoch_millis, type=date}, taskId={index=true, type=keyword}, workflowId={index=true, type=keyword}, status={index=true, type=keyword}}}]"}},"status":400}
conductor_conductor-server.1.jcdqx3h22227@ontheroad-3    |  at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:326) ~[elasticsearch-rest-client-7.15.2.jar!/:7.15.2]
conductor_conductor-server.1.jcdqx3h22227@ontheroad-3    |  at org.elasticsearch.client.RestClient.performRequest(RestClient.java:296) ~[elasticsearch-rest-client-7.15.2.jar!/:7.15.2]
conductor_conductor-server.1.jcdqx3h22227@ontheroad-3    |  at org.elasticsearch.client.RestClient.performRequest(RestClient.java:270) ~[elasticsearch-rest-client-7.15.2.jar!/:7.15.2]
conductor_conductor-server.1.jcdqx3h22227@ontheroad-3    |  at com.netflix.conductor.es7.dao.index.ElasticSearchRestDAOV7.addIndex(ElasticSearchRestDAOV7.java:356) ~[conductor-es7-persistence-3.14.0-SNAPSHOT.jar!/:3.14.0-SNAPSHOT]
conductor_conductor-server.1.jcdqx3h22227@ontheroad-3    |  at com.netflix.conductor.es7.dao.index.ElasticSearchRestDAOV7.createTaskIndex(ElasticSearchRestDAOV7.java:310) ~[conductor-es7-persistence-3.14.0-SNAPSHOT.jar!/:3.14.0-SNAPSHOT]
conductor_conductor-server.1.jcdqx3h22227@ontheroad-3    |  at com.netflix.conductor.es7.dao.index.ElasticSearchRestDAOV7.setup(ElasticSearchRestDAOV7.java:233) ~[conductor-es7-persistence-3.14.0-SNAPSHOT.jar!/:3.14.0-SNAPSHOT]
conductor_conductor-server.1.jcdqx3h22227@ontheroad-3    |  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
conductor_conductor-server.1.jcdqx3h22227@ontheroad-3    |  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
conductor_conductor-server.1.jcdqx3h22227@ontheroad-3    |  at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]

My configurations are:

# Database persistence type.
conductor.db.type=postgres

spring.datasource.url=jdbc:postgresql://postgres:5432/conductor
spring.datasource.username=...
spring.datasource.password=...

# Hikari pool sizes are -1 by default and prevent startup
spring.datasource.hikari.maximum-pool-size=10
spring.datasource.hikari.minimum-idle=2

# Elastic search instance indexing is disabled.
conductor.indexing.enabled=true
conductor.elasticsearch.version=7
conductor.elasticsearch.url=http://es:9200
conductor.elasticsearch.clusterHealthColor=yellow

#Enable Prometheus
conductor.metrics-prometheus.enabled=true
management.endpoints.web.exposure.include=prometheus,health,info,metrics

# GRPC disabled
conductor.grpc-server.enabled=false

# Load sample kitchen sink disabled
loadSample=false

Any hint? Thank you very much.

dcore94 commented 1 year ago

After adding one line of debug I see that createIndex for conductor_task for instance is sending:

{
   "settings" : {
     "number_of_shards" : 5,
     "number_of_replicas" : 1
   },
   "mappings" : {
     "task" : {
       "properties" : { ...

but according to ES 7.6 there seems to be an unnecessary "task" key wrapping the mappings/properties. When removing the key and sending the JSON without it, the request is accepted by ES.

Clarifications?

dcore94 commented 1 year ago

It seems that the extra wrapping node is added while parsing the files at this line

dcore94 commented 1 year ago

Really no one else experienced issues on this?

dcore94 commented 1 year ago

Somehow it looks like the community-server mixes up es6 and es7 resources. The problem disappears if I remove the line https://github.com/Netflix/conductor-community/blob/main/community-server/build.gradle#L12.

I also do "find . -name dependencies.lock -exec rm -v {} \;" and "./gradlew generateLock updateLock saveLock" from inside conductor-community folder before building with "./gradlew build -x test --stacktrace".

github-actions[bot] commented 1 year ago

This issue is stale, because it has been open for 45 days with no activity. Remove the stale label or comment, or this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed, because it has been stalled for 7 days with no activity.