[Bug] [Conditions Task] MismatchedInputException: Cannot deserialize value of type `java.lang.String` from Array value (token `JsonToken.START_ARRAY`); parameters.ConditionsParameters["varPool"] #16558
2024-08-30 19:24:37 [WI-136][TI-303] - [ERROR] 2024-08-30 18:24:37.379 +0100 o.a.d.c.u.JSONUtils:[311] - json to map exception!
2024-08-30 19:24:37 com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type java.lang.String from Array value (token JsonToken.START_ARRAY)
2024-08-30 19:24:37 at [Source: (String)"{"localParams":[],"varPool":[{"prop":"par1","direct":"OUT","type":"VARCHAR","value":"spar1"},{"prop":"par2","direct":"OUT","type":"VARCHAR","value":"spar2"}],"dependence":{"dependTaskList":[{"dependItemList":[{"projectCode":0,"definitionCode":0,"depTaskCode":118357896577408,"cycle":null,"dateValue":null,"dependResult":null,"status":"SUCCESS","parameterPassing":false}],"relation":"AND"}],"relation":"AND"},"conditionResult":{"conditionSuccess":true,"successNode":[118357019633028],"failedNode":[118"[truncated 15 chars]; line: 1, column: 30] (through reference chain: org.apache.dolphinscheduler.plugin.task.api.parameters.ConditionsParameters["varPool"])
2024-08-30 19:24:37 at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
2024-08-30 19:24:37 at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1741)
2024-08-30 19:24:37 at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1515)
2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.std.StdDeserializer._deserializeFromArray(StdDeserializer.java:222)
2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:46)
2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:11)
2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314)
2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)
2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
2024-08-30 19:24:37 at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4674)
2024-08-30 19:24:37 at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3629)
2024-08-30 19:24:37 at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3612)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:309)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.service.utils.DagHelper.parseConditionTask(DagHelper.java:363)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.service.utils.DagHelper.parsePostNodes(DagHelper.java:299)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.submitPostNode(WorkflowExecuteRunnable.java:1170)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.taskFinished(WorkflowExecuteRunnable.java:363)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.event.TaskStateEventHandler.handleStateEvent(TaskStateEventHandler.java:74)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.handleEvents(WorkflowExecuteRunnable.java:283)
2024-08-30 19:24:37 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
2024-08-30 19:24:37 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2024-08-30 19:24:37 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2024-08-30 19:24:37 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2024-08-30 19:24:37 at java.lang.Thread.run(Thread.java:750)
2024-08-30 19:24:37 [WI-136][TI-303] - [ERROR] 2024-08-30 18:24:37.379 +0100 o.a.d.s.m.r.WorkflowExecuteRunnable:[396] - Task finish failed, get a exception, will remove this taskInstance from completeTaskSet
2024-08-30 19:24:37 java.lang.NullPointerException: null
2024-08-30 19:24:37 at org.apache.dolphinscheduler.service.utils.DagHelper.parseConditionTask(DagHelper.java:365)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.service.utils.DagHelper.parsePostNodes(DagHelper.java:299)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.submitPostNode(WorkflowExecuteRunnable.java:1170)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.taskFinished(WorkflowExecuteRunnable.java:363)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.event.TaskStateEventHandler.handleStateEvent(TaskStateEventHandler.java:74)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.handleEvents(WorkflowExecuteRunnable.java:283)
2024-08-30 19:24:37 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
2024-08-30 19:24:37 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2024-08-30 19:24:37 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2024-08-30 19:24:37 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2024-08-30 19:24:37 at java.lang.Thread.run(Thread.java:750)
2024-08-30 19:24:37 [WI-136][TI-303] - [ERROR] 2024-08-30 18:24:37.380 +0100 o.a.d.s.m.r.WorkflowExecuteRunnable:[300] - State event handle error, get a unknown exception, will retry this event: TaskStateEvent(processInstanceId=136, taskInstanceId=303, taskCode=0, status=TaskExecutionStatus{code=7, desc='success'}, type=TASK_STATE_CHANGE, key=null, channel=null, context=null)
2024-08-30 19:24:37 java.lang.NullPointerException: null
2024-08-30 19:24:37 at org.apache.dolphinscheduler.service.utils.DagHelper.parseConditionTask(DagHelper.java:365)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.service.utils.DagHelper.parsePostNodes(DagHelper.java:299)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.submitPostNode(WorkflowExecuteRunnable.java:1170)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.taskFinished(WorkflowExecuteRunnable.java:363)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.event.TaskStateEventHandler.handleStateEvent(TaskStateEventHandler.java:74)
2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.handleEvents(WorkflowExecuteRunnable.java:283)
2024-08-30 19:24:37 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
2024-08-30 19:24:37 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2024-08-30 19:24:37 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2024-08-30 19:24:37 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2024-08-30 19:24:37 at java.lang.Thread.run(Thread.java:750)
How to reproduce
Use Conditions task after HTTP or Shell Task returning one or more parameters.
Search before asking
What happened
Please refer to to Q&A thread: https://github.com/apache/dolphinscheduler/discussions/16399 Workflow never finishes / hangs / loops forever processing the same input and producing the same exceptions.
What you expected to happen
Should process input parameters from varPool.
Instead exceptions are thrown:
2024-08-30 19:24:37 [WI-136][TI-303] - [ERROR] 2024-08-30 18:24:37.379 +0100 o.a.d.c.u.JSONUtils:[311] - json to map exception! 2024-08-30 19:24:37 com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type
java.lang.String
from Array value (tokenJsonToken.START_ARRAY
) 2024-08-30 19:24:37 at [Source: (String)"{"localParams":[],"varPool":[{"prop":"par1","direct":"OUT","type":"VARCHAR","value":"spar1"},{"prop":"par2","direct":"OUT","type":"VARCHAR","value":"spar2"}],"dependence":{"dependTaskList":[{"dependItemList":[{"projectCode":0,"definitionCode":0,"depTaskCode":118357896577408,"cycle":null,"dateValue":null,"dependResult":null,"status":"SUCCESS","parameterPassing":false}],"relation":"AND"}],"relation":"AND"},"conditionResult":{"conditionSuccess":true,"successNode":[118357019633028],"failedNode":[118"[truncated 15 chars]; line: 1, column: 30] (through reference chain: org.apache.dolphinscheduler.plugin.task.api.parameters.ConditionsParameters["varPool"]) 2024-08-30 19:24:37 at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59) 2024-08-30 19:24:37 at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1741) 2024-08-30 19:24:37 at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1515) 2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.std.StdDeserializer._deserializeFromArray(StdDeserializer.java:222) 2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:46) 2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:11) 2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) 2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:314) 2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) 2024-08-30 19:24:37 at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323) 2024-08-30 19:24:37 at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4674) 2024-08-30 19:24:37 at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3629) 2024-08-30 19:24:37 at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3612) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:309) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.service.utils.DagHelper.parseConditionTask(DagHelper.java:363) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.service.utils.DagHelper.parsePostNodes(DagHelper.java:299) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.submitPostNode(WorkflowExecuteRunnable.java:1170) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.taskFinished(WorkflowExecuteRunnable.java:363) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.event.TaskStateEventHandler.handleStateEvent(TaskStateEventHandler.java:74) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.handleEvents(WorkflowExecuteRunnable.java:283) 2024-08-30 19:24:37 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 2024-08-30 19:24:37 at java.util.concurrent.FutureTask.run(FutureTask.java:266) 2024-08-30 19:24:37 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 2024-08-30 19:24:37 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2024-08-30 19:24:37 at java.lang.Thread.run(Thread.java:750) 2024-08-30 19:24:37 [WI-136][TI-303] - [ERROR] 2024-08-30 18:24:37.379 +0100 o.a.d.s.m.r.WorkflowExecuteRunnable:[396] - Task finish failed, get a exception, will remove this taskInstance from completeTaskSet 2024-08-30 19:24:37 java.lang.NullPointerException: null 2024-08-30 19:24:37 at org.apache.dolphinscheduler.service.utils.DagHelper.parseConditionTask(DagHelper.java:365) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.service.utils.DagHelper.parsePostNodes(DagHelper.java:299) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.submitPostNode(WorkflowExecuteRunnable.java:1170) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.taskFinished(WorkflowExecuteRunnable.java:363) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.event.TaskStateEventHandler.handleStateEvent(TaskStateEventHandler.java:74) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.handleEvents(WorkflowExecuteRunnable.java:283) 2024-08-30 19:24:37 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 2024-08-30 19:24:37 at java.util.concurrent.FutureTask.run(FutureTask.java:266) 2024-08-30 19:24:37 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 2024-08-30 19:24:37 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2024-08-30 19:24:37 at java.lang.Thread.run(Thread.java:750) 2024-08-30 19:24:37 [WI-136][TI-303] - [ERROR] 2024-08-30 18:24:37.380 +0100 o.a.d.s.m.r.WorkflowExecuteRunnable:[300] - State event handle error, get a unknown exception, will retry this event: TaskStateEvent(processInstanceId=136, taskInstanceId=303, taskCode=0, status=TaskExecutionStatus{code=7, desc='success'}, type=TASK_STATE_CHANGE, key=null, channel=null, context=null) 2024-08-30 19:24:37 java.lang.NullPointerException: null 2024-08-30 19:24:37 at org.apache.dolphinscheduler.service.utils.DagHelper.parseConditionTask(DagHelper.java:365) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.service.utils.DagHelper.parsePostNodes(DagHelper.java:299) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.submitPostNode(WorkflowExecuteRunnable.java:1170) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.taskFinished(WorkflowExecuteRunnable.java:363) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.event.TaskStateEventHandler.handleStateEvent(TaskStateEventHandler.java:74) 2024-08-30 19:24:37 at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteRunnable.handleEvents(WorkflowExecuteRunnable.java:283) 2024-08-30 19:24:37 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 2024-08-30 19:24:37 at java.util.concurrent.FutureTask.run(FutureTask.java:266) 2024-08-30 19:24:37 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 2024-08-30 19:24:37 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2024-08-30 19:24:37 at java.lang.Thread.run(Thread.java:750)How to reproduce
Use Conditions task after HTTP or Shell Task returning one or more parameters.
Anything else
No response
Version
3.2.x
Are you willing to submit PR?
Code of Conduct