apache/dolphinscheduler · error · ServiceException

10107

10107

Error message

update workflow definition error

What it means

Thrown in updateDag when persisting the updated workflow/task relations fails (a DAO update returns failure or throws), meaning the new task-relation DAG could not be saved. It indicates a persistence-layer error rather than invalid input.

Source

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

            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(
                    "Save new version task relations complete, projectCode:{}, workflowDefinitionCode:{}, newVersion:{}.",
                    workflowDefinition.getProjectCode(), workflowDefinitionCode, insertVersion);
        } else {
            log.error("Update task relations error, projectCode:{}, workflowDefinitionCode:{}.",
                    workflowDefinition.getProjectCode(), workflowDefinitionCode);
            throw new ServiceException(Status.UPDATE_WORKFLOW_DEFINITION_ERROR);
        }

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Check server logs and database health for the underlying update failure.
  2. Retry the DAG update after resolving database issues.
  3. Verify the task relation list is internally consistent before retrying.
Defensive patterns

Strategy: try-catch

When it happens

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