{"record":{"id":"f627236d3414800c","repo":"apache/dolphinscheduler","slug":"name-null","errorCode":"NAME_NULL","errorMessage":"Parameter name can ot be null.","messagePattern":"Parameter name can ot be null\\.","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java","lineNumber":85,"sourceCode":"    @Autowired\n    private ProjectUserDao projectUserDao;\n\n    @Autowired\n    private TaskGroupQueueService taskGroupQueueService;\n\n    @Autowired\n    private ExecutorService executorService;\n\n    @Override\n    @Transactional\n    public TaskGroup createTaskGroup(User loginUser, Long projectCode, String name, String description, int groupSize) {\n        requireProjectPerm(loginUser, projectCode, true);\n        if (checkDescriptionLength(description)) {\n            log.warn(\"Parameter description is too long.\");\n            throw new ServiceException(Status.DESCRIPTION_TOO_LONG_ERROR);\n        }\n        if (name == null) {\n            log.warn(\"Parameter name can ot be null.\");\n            throw new ServiceException(Status.NAME_NULL);\n        }\n        if (groupSize <= 0) {\n            log.warn(\"Parameter task group size is must bigger than 1.\");\n            throw new ServiceException(Status.TASK_GROUP_SIZE_ERROR);\n        }\n        TaskGroup duplicate = taskGroupMapper.queryByName(loginUser.getId(), name);\n        if (duplicate != null) {\n            log.warn(\"Task group with the same name already exists, taskGroupName:{}.\", duplicate.getName());\n            throw new ServiceException(Status.TASK_GROUP_NAME_EXSIT);\n        }\n        Date now = new Date();\n        TaskGroup taskGroup = TaskGroup.builder()\n                .name(name)\n                .projectCode(projectCode)\n                .description(description)\n                .groupSize(groupSize)\n                .userId(loginUser.getId())","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java#L67-L103","documentation":"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.","triggerScenarios":"POSTing to the task-group create endpoint without the name field (omitted key, null JSON value, or empty form control that serializes as null).","commonSituations":"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.","solutions":["Provide a non-null name in the create-task-group request body.","Validate required form fields client-side before submitting.","Treat empty string as missing and substitute or reject before the API call.","Check the service/module mapping — the name parameter may be bound under a different key than the client sends."],"exampleFix":"// before\nawait createTaskGroup({ description: 'group', groupSize: 5 })\n// after\nconst payload = { name: 'etl-group', description: 'group', groupSize: 5 }\nif (!payload.name) throw new Error('task group name is required')\nawait createTaskGroup(payload)","handlingStrategy":"validation","validationCode":"function canCreateTaskGroup(p: { name?: string | null; groupSize: number; description?: string }): string | null {\n  if (!p.name || !p.name.trim()) return 'name is required'\n  if (p.groupSize <= 0) return 'groupSize must be > 0'\n  return null\n}","typeGuard":"function hasName(p: { name?: string | null }): p is { name: string } & typeof p {\n  return typeof p.name === 'string' && p.name.trim().length > 0\n}","tryCatchPattern":"try {\n  await createTaskGroup(payload)\n} catch (e) {\n  if (isServiceException(e, 'NAME_NULL')) {\n    formErrors.name = 'Task group name is required'\n  } else throw e\n}","preventionTips":["Mark the name field required in forms and block submission while empty.","Trim and check for empty string before sending (empty string behaves like missing).","In scripts, destructure and assert required fields before building the request."],"tags":["parameter-validation","null","api"],"backgroundTag":"missing-required-argument","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}