{"record":{"id":"aab17a5e8321d191","repo":"apache/dolphinscheduler","slug":"the-dependent-task-s-taskdefinition-is-not-exist","errorCode":null,"errorMessage":"The dependent task's taskDefinition is not exist, dependentItem: ${dependentItem}","messagePattern":"The dependent task's taskDefinition is not exist, dependentItem: (.+?)","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/executor/plugin/dependent/DependentTaskTracker.java","lineNumber":189,"sourceCode":"                        }\n                        if (dependentItem.getDepTaskCode() == Constants.DEPENDENT_ALL_TASK_CODE) {\n                            log.info(\n                                    \"Add dependent all task, ProjectName: {}, WorkflowName: {}, WorkflowCode: {}, DependentCycle: {}, DependentCycleDate: {}, DependentRelation: {}\",\n                                    project.getName(), workflowDefinition.getName(), workflowDefinition.getCode(),\n                                    dependentItem.getCycle(), dependentItem.getDateValue(),\n                                    dependentTaskModel.getRelation());\n                        } else if (dependentItem.getDepTaskCode() == Constants.DEPENDENT_WORKFLOW_CODE) {\n                            log.info(\n                                    \"Add dependent workflow task, ProjectName: {}, WorkflowName: {}, WorkflowCode: {}, DependentCycle: {}, DependentCycleDate: {}, DependentRelation: {}\",\n                                    project.getName(), workflowDefinition.getName(), workflowDefinition.getCode(),\n                                    dependentItem.getCycle(), dependentItem.getDateValue(),\n                                    dependentTaskModel.getRelation());\n                        } else {\n                            TaskDefinition taskDefinition = taskDefinitionMap.get(dependentItem.getDepTaskCode());\n                            if (taskDefinition == null) {\n                                log.error(\"The dependent task's taskDefinition is not exist, dependentItem: {}\",\n                                        dependentItem);\n                                throw new RuntimeException(\n                                        \"The dependent task's taskDefinition is not exist, dependentItem: \"\n                                                + dependentItem);\n                            }\n                            log.info(\n                                    \"Add dependent task, ProjectName: {}, WorkflowName: {}, WorkflowCode: {}, TaskName: {}, DependentCycle: {}, DependentCycleDate: {}, DependentRelation: {}\",\n                                    project.getName(), workflowDefinition.getName(), workflowDefinition.getCode(),\n                                    taskDefinition.getName(), dependentItem.getCycle(), dependentItem.getDateValue(),\n                                    dependentTaskModel.getRelation());\n                        }\n                    }\n                    return new DependentExecute(dependentTaskModel.getDependItemList(),\n                            dependentTaskModel.getRelation(), workflowInstance, taskInstance);\n                }).collect(Collectors.toList());\n        log.info(\"Initialized dependent task list successfully\");\n        return dependentExecutes;\n    }\n\n    private void initTaskDependentResult() {","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/executor/plugin/dependent/DependentTaskTracker.java#L171-L207","documentation":"For dependent items that reference a specific task (not DEPENDENT_ALL_TASK_CODE), initializeDependentTaskList looks the depTaskCode up in the task definition map; when absent it throws this RuntimeException because the specific dependency target cannot be evaluated.","triggerScenarios":"A dependent item points to depTaskCode of a task definition that was deleted, or the task was renamed/re-created so its code changed while the dependent item kept the old code.","commonSituations":"Deleting or recreating a task node that other workflows depend on, restoring workflow definitions without their task definitions, or cross-project dependencies after cleanup scripts.","solutions":["Edit the dependent task in the UI to remove the stale task dependency or point it at the recreated task","Recreate the missing task definition in the referenced workflow","Verify the code in t_ds_task_definition to confirm whether the task exists under a different code"],"exampleFix":"// before: depTaskCode 55555 (task deleted)\n// after: update dependent item's depTaskCode to the new task's code after re-saving the upstream task","handlingStrategy":"validation","validationCode":"if (item.getDepTaskCode() != Constants.DEPENDENT_ALL_TASK_CODE\n        && taskDefinitionDao.find_by_code(item.getDepTaskCode()) == null) {\n    // dependent task missing — fix dependent item\n}","typeGuard":null,"tryCatchPattern":"try {\n    tracker.initializeDependentTaskList();\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"taskDefinition is not exist\")) {\n        taskFailed(\"Dependent task definition deleted; edit dependent task\");\n    }\n}","preventionTips":["Re-save dependent tasks after recreating referenced task nodes (codes change on recreate)","Avoid manual deletion of task definitions from the DB","Audit dependent items against t_ds_task_definition regularly"],"tags":["dependent-task","data-integrity","master-server"],"backgroundTag":"entity-not-found","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"}