apache/dolphinscheduler · critical · ServiceException

130008

130008

Error message

create task group error

What it means

After passing all validations, createTaskGroup inserts the new TaskGroup; if taskGroupMapper.insert returns <= 0 (no row written), it throws Status.CREATE_TASK_GROUP_ERROR (code 130008). This indicates the insert unexpectedly failed at the persistence layer despite valid input.

Source

Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java:111

        if (duplicate != null) {
            log.warn("Task group with the same name already exists, taskGroupName:{}.", duplicate.getName());
            throw new ServiceException(Status.TASK_GROUP_NAME_EXSIT);
        }
        Date now = new Date();
        TaskGroup taskGroup = TaskGroup.builder()
                .name(name)
                .projectCode(projectCode)
                .description(description)
                .groupSize(groupSize)
                .userId(loginUser.getId())
                .status(Flag.YES)
                .createTime(now)
                .updateTime(now)
                .build();

        if (taskGroupMapper.insert(taskGroup) <= 0) {
            log.error("Create task group error, taskGroupName:{}.", taskGroup.getName());
            throw new ServiceException(Status.CREATE_TASK_GROUP_ERROR);
        }
        log.info("Create task group complete, taskGroupName:{}.", taskGroup.getName());
        return taskGroup;
    }

    @Override
    public TaskGroup updateTaskGroup(User loginUser, int id, String name, String description, int groupSize) {
        TaskGroup taskGroup = taskGroupMapper.selectById(id);
        requireProjectPerm(loginUser, taskGroup.getProjectCode(), true);
        if (checkDescriptionLength(description)) {
            log.warn("Parameter description is too long.");
            throw new ServiceException(Status.DESCRIPTION_TOO_LONG_ERROR);
        }
        if (name == null) {
            log.warn("Parameter name can ot be null.");
            throw new ServiceException(Status.NAME_NULL);
        }
        if (groupSize <= 0) {

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Check the API server logs around this error for the underlying SQL/DB exception.
  2. Verify the t_ds_task_group table exists with the expected schema.
  3. Confirm the datasource is writable and healthy; retry after restoring DB connectivity.

Example fix

// before
// ignoring DB health, blindly retrying create
createTaskGroup(user, projectCode, name, desc, size);
// after
try {
    createTaskGroup(user, projectCode, name, desc, size);
} catch (ServiceException e) {
    if (e.getCode() == 130008) { checkDbHealthAndRetry(); }
}
Defensive patterns

Strategy: retry

Validate before calling

// pre-check DB connectivity if embedding the service:
// try (SqlSession s = sqlSessionFactory.openSession()) { s.getConnection().isValid(3); }

Try / catch

try { api.createTaskGroup(u, pc, name, desc, size); }
catch (ServiceException e) { if (e.getCode() == 130008) { logServerError(e); checkDbHealth(); retryWithBackoff(); } }

Prevention

When it happens

Trigger: DB insert affecting zero rows during createTaskGroup — typically underlying database errors surfaced as 0 affected rows, a transaction rollback condition, or a misconfigured datasource.

Common situations: Database connectivity issues or constraint violations at insert time; schema drift between code and DB (missing t_ds_task_group columns); read-only replica used for writes.

Related errors


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