apache/dolphinscheduler · error · ServiceException

50030

50030

Error message

task definition [{0}] does not exist

What it means

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).

Source

Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java:128

     * query task definition
     *
     * @param loginUser   login user
     * @param projectCode project code
     * @param workflowDefinitionCode workflow definition code
     * @param taskName    task name
     */
    @Override
    public TaskDefinition queryTaskDefinitionByName(User loginUser, long projectCode, long workflowDefinitionCode,
                                                    String taskName) {
        Project project = projectDao.queryByCode(projectCode);
        // check user access for project
        projectService.checkProjectAndAuthThrowException(loginUser, project, TASK_DEFINITION);

        TaskDefinition taskDefinition =
                taskDefinitionDao.queryByName(project.getCode(), workflowDefinitionCode, taskName);
        if (taskDefinition == null) {
            log.error("Task definition does not exist, taskName:{}.", taskName);
            throw new ServiceException(Status.TASK_DEFINE_NOT_EXIST, taskName);
        }
        return taskDefinition;
    }

    public void updateDag(User loginUser, long workflowDefinitionCode,
                          List<WorkflowTaskRelation> workflowTaskRelationList,
                          List<TaskDefinitionLog> taskDefinitionLogs) {
        WorkflowDefinition workflowDefinition = workflowDefinitionDao.queryByCode(workflowDefinitionCode).orElse(null);
        if (workflowDefinition == null) {
            log.error("workflow definition does not exist, workflowDefinitionCode:{}.", workflowDefinitionCode);
            throw new ServiceException(Status.WORKFLOW_DEFINITION_NOT_EXIST);
        }
        int insertVersion =
                processService.saveWorkflowDefine(loginUser, workflowDefinition, Boolean.TRUE, Boolean.TRUE);
        if (insertVersion <= 0) {
            log.error("Update workflow definition error, projectCode:{}, workflowDefinitionCode:{}.",
                    workflowDefinition.getProjectCode(), workflowDefinitionCode);
            throw new ServiceException(Status.UPDATE_WORKFLOW_DEFINITION_ERROR);

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Verify the task name spelling and that it exists in the given workflow.
  2. Confirm the project code and workflow definition code are correct.
  3. Check the task was not deleted or renamed by another user.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java:128 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/12e8aa34ce38f7ea. Report an issue: GitHub.