apache/dolphinscheduler · error · ServiceException

50003

50003

Error message

workflow definition {0} does not exist

What it means

Raised in updateDag (also reachable via switchVersion) when the workflow definition for workflowDefinitionCode does not exist, so the DAG cannot be updated. It is an existence guard; the faulting input is the workflow definition code that has no matching record.

Source

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

        // 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);
        } else
            log.info(
                    "Save new version workflow definition complete, projectCode:{}, workflowDefinitionCode:{}, newVersion:{}.",
                    workflowDefinition.getProjectCode(), workflowDefinitionCode, insertVersion);
        List<WorkflowTaskRelationLog> relationLogs =
                workflowTaskRelationList.stream().map(WorkflowTaskRelationLog::new).collect(Collectors.toList());
        int insertResult = processService.saveTaskRelation(loginUser, workflowDefinition.getProjectCode(),
                workflowDefinition.getCode(),
                insertVersion, relationLogs, taskDefinitionLogs, Boolean.TRUE);
        if (insertResult == Constants.EXIT_CODE_SUCCESS) {
            log.info(

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Verify the workflow definition code is correct.
  2. Ensure the workflow was not deleted before this call.
  3. Refresh the workflow list to obtain valid codes.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java:139 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/2b1b91c02bd07273. Report an issue: GitHub.