apache/dolphinscheduler · error · ServiceException

NAME_NULL

NAME_NULL

Error message

Parameter name can ot be null.

What it means

createTaskGroup requires a non-null name; after validating description length it checks `name == null` and throws ServiceException(Status.NAME_NULL) when absent. Names are used for uniqueness lookup (queryByName), so a null name cannot proceed.

Source

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

    @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)
                .description(description)
                .groupSize(groupSize)
                .userId(loginUser.getId())

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Provide a non-null name in the create-task-group request body.
  2. Validate required form fields client-side before submitting.
  3. Treat empty string as missing and substitute or reject before the API call.
  4. Check the service/module mapping — the name parameter may be bound under a different key than the client sends.

Example fix

// before
await createTaskGroup({ description: 'group', groupSize: 5 })
// after
const payload = { name: 'etl-group', description: 'group', groupSize: 5 }
if (!payload.name) throw new Error('task group name is required')
await createTaskGroup(payload)
Defensive patterns

Strategy: validation

Validate before calling

function canCreateTaskGroup(p: { name?: string | null; groupSize: number; description?: string }): string | null {
  if (!p.name || !p.name.trim()) return 'name is required'
  if (p.groupSize <= 0) return 'groupSize must be > 0'
  return null
}

Type guard

function hasName(p: { name?: string | null }): p is { name: string } & typeof p {
  return typeof p.name === 'string' && p.name.trim().length > 0
}

Try / catch

try {
  await createTaskGroup(payload)
} catch (e) {
  if (isServiceException(e, 'NAME_NULL')) {
    formErrors.name = 'Task group name is required'
  } else throw e
}

Prevention

When it happens

Trigger: POSTing to the task-group create endpoint without the name field (omitted key, null JSON value, or empty form control that serializes as null).

Common situations: New UI form submitted before the name input is filled; API scripts building the payload programmatically and skipping name; JSON payloads where name is explicitly "name": null.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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