apache/dolphinscheduler · warning · ServiceException

1400004

1400004

Error message

description is too long error

What it means

updateClusterByCode validates the cluster description length via checkDescriptionLength(desc); when the description exceeds the allowed maximum it throws ServiceException(Status.DESCRIPTION_TOO_LONG_ERROR, code 1400004). This is a simple input-size validation on the desc field of the cluster update request.

Source

Thrown at dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ClusterServiceImpl.java:228

     *
     * @param loginUser login user
     * @param code      cluster code
     * @param name      cluster name
     * @param config    cluster config
     * @param desc      cluster desc
     */
    @Override
    public Cluster updateClusterByCode(User loginUser,
                                       Long code,
                                       String name,
                                       String config,
                                       String desc) {
        if (isNotAdmin(loginUser)) {
            throw new ServiceException(Status.USER_NO_OPERATION_PERM);
        }

        if (checkDescriptionLength(desc)) {
            throw new ServiceException(Status.DESCRIPTION_TOO_LONG_ERROR);
        }

        checkParams(name, config);

        Cluster clusterExistByName = clusterDao.queryByClusterName(name);
        if (clusterExistByName != null && !clusterExistByName.getCode().equals(code)) {
            throw new ServiceException(Status.CLUSTER_NAME_EXISTS, name);
        }

        Cluster clusterExist = clusterDao.queryByClusterCode(code);
        if (clusterExist == null) {
            throw new ServiceException(Status.CLUSTER_NOT_EXISTS, name);
        }

        if (!Constants.K8S_LOCAL_TEST_CLUSTER_CODE.equals(clusterExist.getCode())
                && !config.equals(ClusterConfUtils.getK8sConfig(clusterExist.getConfig()))) {
            try {
                k8sManager.getAndUpdateK8sClient(code, true);

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Shorten the description to under the maximum length (255 characters for the default schema).
  2. Store long documentation externally (wiki/link) and keep only a short summary in desc.
  3. Truncate the description programmatically before calling the API.
  4. If longer descriptions are genuinely needed, alter the column size and update the limit in code.

Example fix

// before
desc = veryLongMarkdown;
clusterService.updateClusterByCode(loginUser, code, name, config, desc);
// after
if (desc != null && desc.length() > 255) {
    desc = desc.substring(0, 255);
}
clusterService.updateClusterByCode(loginUser, code, name, config, desc);
Defensive patterns

Strategy: validation

Validate before calling

// Java
if (desc != null && desc.length() > 255) {
    throw new IllegalArgumentException("description must be <= 255 chars, got " + desc.length());
}

Prevention

When it happens

Trigger: PUT /clusters/{code} (or updateClusterByCode) called with a desc string longer than the configured limit (Constants.DESCRIPTION length, 255 chars by default schema).

Common situations: Pasting long runbooks/notes into the cluster description field; scripts writing markdown docs into desc; UI clients not enforcing maxlength.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


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