apache/dolphinscheduler · error · ServiceException

1400004

1400004

Error message

description is too long error

What it means

createTaskGroup rejects the request because the supplied task-group description exceeds the maximum allowed length (enforced by checkDescriptionLength). DolphinScheduler limits description size so task-group metadata stays compact in the DB and API responses. The call fails fast with status DESCRIPTION_TOO_LONG_ERROR (code 1400004) before any insert is attempted.

Source

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

    @Autowired
    private ProjectDao projectDao;

    @Autowired
    private ProjectUserDao projectUserDao;

    @Autowired
    private TaskGroupQueueService taskGroupQueueService;

    @Autowired
    private ExecutorService executorService;

    @Override
    @Transactional
    public TaskGroup createTaskGroup(User loginUser, Long projectCode, String name, String description, int groupSize) {
        requireProjectPerm(loginUser, projectCode, 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) {
            log.warn("Parameter task group size is must bigger than 1.");
            throw new ServiceException(Status.TASK_GROUP_SIZE_ERROR);
        }
        TaskGroup duplicate = taskGroupMapper.queryByName(loginUser.getId(), name);
        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)

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Shorten the description to within the allowed limit (default 255 chars).
  2. Check dolphinscheduler task-group desc length config (task-group-desc-length) and align client-side maxLength with it.
  3. Truncate the description in client code before calling the API.

Example fix

// before
group.setDescription(longText);
apiClient.createTaskGroup(user, projectCode, name, longText, size);
// after
String desc = longText != null && longText.length() > 255 ? longText.substring(0, 255) : longText;
apiClient.createTaskGroup(user, projectCode, name, desc, size);
Defensive patterns

Strategy: validation

Validate before calling

if (description != null && description.length() > 255) {
    throw new IllegalArgumentException("description exceeds max length");
}

Try / catch

try { api.createTaskGroup(u, pc, name, desc, size); }
catch (ServiceException e) { if (e.getCode() == 1400004) { desc = desc.substring(0, 255); retry(); } }

Prevention

When it happens

Trigger: Calling POST /task-group/update-or-create (create path) with a description string longer than the configured max length (TaskGroupConfiguration taskGroupDescLength, default 255). Also triggered when a client copies a long workflow/task description into the group description field.

Common situations: Clients pasting long free-text notes or Markdown into the description field; UI not enforcing maxLength; API scripts building groups programmatically with generated long descriptions.

Understand the failure class

Background: payload too large / request exceeds maximum size: why libraries cap bytes and how to fix oversize payloads — this error's family across 50 libraries.

Related errors


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