Skip to content

[Bug] [MasterServer] switch task run error #7019

@caishunfeng

Description

@caishunfeng

Search before asking

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

What happened

branch: 2.0

[ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.common.utils.JSONUtils:[129] - parse object exception!
com.fasterxml.jackson.databind.JsonMappingException: java.lang.Long cannot be cast to java.util.ArrayList
 at [Source: (String)"{"dependTaskList":[{"condition":"${today}==20211201","nextNode":3645680828192},{"condition":"${today}==20211101","nextNode":3645675551008}],"nextNode":3645675551008}"; line: 1, column: 65] (through reference chain: org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters["dependTaskList"]->java.util.ArrayList[0]->org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo["nextNode"])
        at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:281)
        at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:611)
        at com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:599)
        at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:143)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
        at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3182)
        at org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject(JSONUtils.java:127)
        at org.apache.dolphinscheduler.dao.entity.TaskInstance.getSwitchDependency(TaskInstance.java:473)
        at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:138)
        at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
        at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
        at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
        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:748)
Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.ArrayList
        at org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo.setNextNode(SwitchResultVo.java:46)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:141)
        ... 30 common frames omitted
[ERROR] 2021-11-26 18:46:39.370 org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor:[92] - update work flow 78 switch task 380 state error:
java.lang.NullPointerException: null
        at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.setSwitchResult(SwitchTaskProcessor.java:139)
        at org.apache.dolphinscheduler.server.master.runner.task.SwitchTaskProcessor.run(SwitchTaskProcessor.java:88)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitTaskExec(WorkflowExecuteThread.java:616)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitStandByTask(WorkflowExecuteThread.java:1244)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:858)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskFinished(WorkflowExecuteThread.java:391)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.taskStateChangeHandler(WorkflowExecuteThread.java:348)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.stateEventHandler(WorkflowExecuteThread.java:297)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.handleEvents(WorkflowExecuteThread.java:245)
        at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:225)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
        at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
        at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
        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:748)

it seems like the task params was dismatch between ui and server, which cause conversion failure.

What you expected to happen

switch task run normally.

How to reproduce

create a switch task and run it.

Anything else

No response

Version

2.0.0

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

Waiting for replyWaiting for replybugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions