{"record":{"id":"12e8aa34ce38f7ea","repo":"apache/dolphinscheduler","slug":"50030","errorCode":"50030","errorMessage":"task definition [{0}] does not exist","messagePattern":"task definition \\[(.+?)\\] does not exist","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java","lineNumber":128,"sourceCode":"     * query task definition\n     *\n     * @param loginUser   login user\n     * @param projectCode project code\n     * @param workflowDefinitionCode workflow definition code\n     * @param taskName    task name\n     */\n    @Override\n    public TaskDefinition queryTaskDefinitionByName(User loginUser, long projectCode, long workflowDefinitionCode,\n                                                    String taskName) {\n        Project project = projectDao.queryByCode(projectCode);\n        // check user access for project\n        projectService.checkProjectAndAuthThrowException(loginUser, project, TASK_DEFINITION);\n\n        TaskDefinition taskDefinition =\n                taskDefinitionDao.queryByName(project.getCode(), workflowDefinitionCode, taskName);\n        if (taskDefinition == null) {\n            log.error(\"Task definition does not exist, taskName:{}.\", taskName);\n            throw new ServiceException(Status.TASK_DEFINE_NOT_EXIST, taskName);\n        }\n        return taskDefinition;\n    }\n\n    public void updateDag(User loginUser, long workflowDefinitionCode,\n                          List<WorkflowTaskRelation> workflowTaskRelationList,\n                          List<TaskDefinitionLog> taskDefinitionLogs) {\n        WorkflowDefinition workflowDefinition = workflowDefinitionDao.queryByCode(workflowDefinitionCode).orElse(null);\n        if (workflowDefinition == null) {\n            log.error(\"workflow definition does not exist, workflowDefinitionCode:{}.\", workflowDefinitionCode);\n            throw new ServiceException(Status.WORKFLOW_DEFINITION_NOT_EXIST);\n        }\n        int insertVersion =\n                processService.saveWorkflowDefine(loginUser, workflowDefinition, Boolean.TRUE, Boolean.TRUE);\n        if (insertVersion <= 0) {\n            log.error(\"Update workflow definition error, projectCode:{}, workflowDefinitionCode:{}.\",\n                    workflowDefinition.getProjectCode(), workflowDefinitionCode);\n            throw new ServiceException(Status.UPDATE_WORKFLOW_DEFINITION_ERROR);","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java#L110-L146","documentation":"Thrown in queryTaskDefinitionByName when taskDefinitionDao.queryByName finds no task definition matching the given name under the specified project and workflow definition. It is an existence guard; the faulting input is the taskName (or the workflow/project code scoping it).","triggerScenarios":"Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java:128 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the task name spelling and that it exists in the given workflow.","Confirm the project code and workflow definition code are correct.","Check the task was not deleted or renamed by another user."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}