{"record":{"id":"371c0f9d8d1fe3bd","repo":"apache/dolphinscheduler","slug":"dispatch-logictask-to-s-failed-response-is-s","errorCode":null,"errorMessage":"\"Dispatch LogicTask to %s failed, response is: %s\" (formatted with taskExecutionContext.getHost(), logicTaskDispatchResponse)","messagePattern":"\"Dispatch LogicTask to (.+?) failed, response is: (.+?)\" \\(formatted with taskExecutionContext\\.getHost\\(\\), logicTaskDispatchResponse\\)","errorType":"exception","errorClass":"TaskDispatchException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/client/LogicTaskExecutorClientDelegator.java","lineNumber":65,"sourceCode":"public class LogicTaskExecutorClientDelegator implements ITaskExecutorClientDelegator {\n\n    @Autowired\n    private MasterConfig masterConfig;\n\n    @Override\n    public void dispatch(final ITaskExecution taskExecution) throws TaskDispatchException {\n        final String logicTaskExecutorAddress = masterConfig.getMasterAddress();\n        final TaskExecutionContext taskExecutionContext = taskExecution.getTaskExecutionContext();\n\n        taskExecutionContext.setHost(logicTaskExecutorAddress);\n        taskExecution.getTaskInstance().setHost(logicTaskExecutorAddress);\n\n        final TaskExecutorDispatchResponse logicTaskDispatchResponse = Clients\n                .withService(ILogicTaskExecutorOperator.class)\n                .withHost(logicTaskExecutorAddress)\n                .dispatchTask(TaskExecutorDispatchRequest.of(taskExecutionContext));\n        if (!logicTaskDispatchResponse.isDispatchSuccess()) {\n            throw new TaskDispatchException(\n                    String.format(\"Dispatch LogicTask to %s failed, response is: %s\",\n                            taskExecutionContext.getHost(), logicTaskDispatchResponse));\n        }\n    }\n\n    @Override\n    public boolean reassignMasterHost(final ITaskExecution taskExecution) {\n        // The Logic Task doesn't support take-over, since the logic task is not executed on the worker.\n        return false;\n    }\n\n    @Override\n    public void pause(final ITaskExecution taskExecution) {\n        final TaskInstance taskInstance = taskExecution.getTaskInstance();\n        final String executorHost = taskInstance.getHost();\n        final String taskName = taskInstance.getName();\n        checkArgument(StringUtils.isNotEmpty(executorHost), \"Executor host is empty\");\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/client/LogicTaskExecutorClientDelegator.java#L47-L83","documentation":"The master dispatches a logic task (e.g. dependent, condition, switch) to itself via RPC and this error means the master-side executor replied with an unsuccessful TaskExecutorDispatchResponse. TaskDispatchException is thrown by LogicTaskExecutorClientDelegator.dispatch after the RPC round-trip succeeds but the response reports failure, so the target master accepted the request but could not start the task.","triggerScenarios":"Clients.withService(ILogicTaskExecutorOperator.class).withHost(masterAddress).dispatchTask(...) returns a response whose isDispatchSuccess() is false, i.e. the local logic-task executor rejected or failed to initialize the dispatched TaskExecutionContext.","commonSituations":"Master is overloaded or shutting down while accepting dispatches; the task plugin for the logic task fails to initialize (missing plugin jar, bad params); a version-mismatched master handling a forwarded request; resource/thread exhaustion in the logic task executor.","solutions":["Inspect the full log line: the TaskExecutorDispatchResponse in the message usually carries the rejection reason; fix the underlying cause it reports","Verify the master process is healthy and not shutting down or out of threads/memory; restart or scale the master if needed","Check that the task plugin for the logic task type is installed and its parameters are valid","Retry the workflow instance; transient master-side failures typically succeed on re-run"],"exampleFix":"// before\n// dispatch failure surfaces only at runtime as TaskDispatchException\n// after\n// pre-check before triggering the workflow\nif (!masterConfig.getMasterAddress().equals(host)) {\n    throw new IllegalStateException(\"Logic tasks must run on the master: \" + masterConfig.getMasterAddress());\n}","handlingStrategy":"try-catch","validationCode":"if (!masterConfig.getMasterAddress().equals(taskExecutionContext.getHost())) {\n    throw new IllegalStateException(\"Logic task host must be the master address\");\n}","typeGuard":"boolean isLogicTaskDispatchSuccessful(TaskExecutorDispatchResponse r) { return r != null && r.isDispatchSuccess(); }","tryCatchPattern":"try {\n    taskExecutorClient.dispatch(taskExecution);\n} catch (TaskDispatchException e) {\n    log.error(\"Logic task dispatch to {} failed: {}\", taskExecution.getTaskExecutionContext().getHost(), e.getMessage());\n    // mark task failed or retry per workflow failure strategy\n}","preventionTips":["Monitor master health (threads, memory) so the local logic executor can accept dispatches","Keep task plugins installed and version-aligned on the master","Use workflow failure/retry strategies so transient dispatch failures self-heal","Check master logs for dispatch response details before restarting anything"],"tags":["rpc","task-dispatch","master"],"backgroundTag":"task-dispatch-failed","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}