{"record":{"id":"d1a2eb9f6766c34d","repo":"apache/dolphinscheduler","slug":"request-params-not-valid-error-d1a2eb","errorCode":"REQUEST_PARAMS_NOT_VALID_ERROR","errorMessage":"REQUEST_PARAMS_NOT_VALID_ERROR: request parameter {queue} is not valid","messagePattern":"REQUEST_PARAMS_NOT_VALID_ERROR: request parameter (.+?) is not valid","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java","lineNumber":75,"sourceCode":"public class QueueServiceImpl extends BaseServiceImpl implements QueueService {\n\n    @Autowired\n    private QueueDao queueDao;\n\n    @Autowired\n    private UserDao userDao;\n\n    @Autowired\n    private TenantDao tenantDao;\n\n    /**\n     * Check the queue new object valid or not\n     *\n     * @param queue The queue object want to create\n     */\n    private void validQueue(Queue queue) throws ServiceException {\n        if (StringUtils.isEmpty(queue.getQueue())) {\n            throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR, Constants.QUEUE);\n        } else if (StringUtils.isEmpty(queue.getQueueName())) {\n            throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR, Constants.QUEUE_NAME);\n        } else if (checkQueueExist(queue.getQueue())) {\n            throw new ServiceException(Status.QUEUE_VALUE_EXIST, queue.getQueue());\n        } else if (checkQueueNameExist(queue.getQueueName())) {\n            throw new ServiceException(Status.QUEUE_NAME_EXIST, queue.getQueueName());\n        }\n    }\n\n    /**\n     * Check queue update object valid or not\n     *\n     * @param existsQueue The exists queue object\n     * @param updateQueue The queue object want to update\n     */\n    private void updateQueueValid(Queue existsQueue, Queue updateQueue) throws ServiceException {\n        // Check the exists queue and the necessary of update operation, in not exist checker have to use updateQueue to\n        // avoid NPE","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java#L57-L93","documentation":"Thrown by QueueServiceImpl.validQueue when the Queue object's queue value (the YARN queue name, keyed by Constants.QUEUE) is empty. validQueue runs on createQueue, verifyQueue and createQueueIfNotExists, so any of those calls with a blank queue field fails with 'request parameter {queue} is not valid'.","triggerScenarios":"createQueue/verifyQueue called with queue==null or empty string; createQueueIfNotExists invoked with a queue object missing the queue field (e.g. deserialized payload without 'queue').","commonSituations":"Admin UI form submitted with only the display name filled; REST clients sending queueName but omitting queue; tenant creation flow passing an empty queue; migration scripts copying records with null queue.","solutions":["Supply a non-empty queue value (the actual YARN queue name) in the request","Validate queue non-blank in the client before calling the API","Fix the payload mapping so the 'queue' field is populated, not just queueName"],"exampleFix":"// before\nqueueService.createQueue(loginUser, \"\", \"myQueueName\");\n// after\nif (StringUtils.isNotBlank(queueValue)) {\n    queueService.createQueue(loginUser, queueValue, \"myQueueName\");\n} else {\n    putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, \"queue\");\n}","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(queue)) {\n    throw new IllegalArgumentException(\"queue is required\");\n}\nif (StringUtils.isBlank(queueName)) {\n    throw new IllegalArgumentException(\"queueName is required\");\n}","typeGuard":"boolean isValidQueue = q != null\n        && StringUtils.isNotBlank(q.getQueue())\n        && StringUtils.isNotBlank(q.getQueueName());","tryCatchPattern":"try {\n    queueService.createQueue(loginUser, queue, queueName);\n} catch (ServiceException e) {\n    if (e.getCode() == Status.REQUEST_PARAMS_NOT_VALID_ERROR) {\n        putMsg(result, e.getCode(), \"queue\");\n        return result;\n    }\n    throw e;\n}","preventionTips":["Enforce non-blank 'queue' and 'queueName' fields in forms and DTOs","Call verifyQueue before persisting tenants/queues","Validate payload field mapping so 'queue' is never dropped in serialization"],"tags":["queue","validation","api"],"backgroundTag":"empty-required-field","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"}