{"record":{"id":"42b93f8da8e5228e","repo":"apache/dolphinscheduler","slug":"queue-name-exist","errorCode":"QUEUE_NAME_EXIST","errorMessage":"QUEUE_NAME_EXIST: queue name {queueName} already exists","messagePattern":"QUEUE_NAME_EXIST: queue name (.+?) already exists","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java","lineNumber":81,"sourceCode":"    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\n        if (Objects.isNull(existsQueue)) {\n            throw new ServiceException(Status.QUEUE_NOT_EXIST, updateQueue.getQueue());\n        } else if (Objects.equals(existsQueue, updateQueue)) {\n            throw new ServiceException(Status.NEED_NOT_UPDATE_QUEUE);\n        }\n        // Check the update queue parameters","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java#L63-L99","documentation":"QUEUE_NAME_EXIST is thrown by validQueue() when the queue display name already exists. checkQueueNameExist(queue.getQueueName()) returns true, so a new queue with this name would break name uniqueness. Raised from createQueue, verifyQueue, and createQueueIfNotExists.","triggerScenarios":"createQueue with a queueName matching an existing queue row; verifyQueue probing a taken name; createQueueIfNotExists when a different queue row already uses the same name.","commonSituations":"Renaming a queue to a name another queue already uses; seeding the same queue set twice; case-sensitivity surprises where names differ only by case depending on DB collation.","solutions":["Pick a unique queueName","Verify the name via verifyQueue before creating","If updating, use updateQueue instead of create"],"exampleFix":"// before\nqueueService.createQueue(loginUser, \"low\", \"DefaultQueue\"); // name taken\n// after\nqueueService.createQueue(loginUser, \"low\", \"LowPriorityQueue\");","handlingStrategy":"try-catch","validationCode":"boolean nameTaken = !queueService.verifyQueue(loginUser, queue, queueName).isSuccess(); // QUEUE_NAME_EXIST means taken","typeGuard":null,"tryCatchPattern":"try {\n    queueService.createQueue(loginUser, queue, queueName);\n} catch (ServiceException e) {\n    if (e.getCode() == Status.QUEUE_NAME_EXIST.getCode()) { /* pick another name or reuse */ }\n    throw e;\n}","preventionTips":["Verify names are unique before creating","Keep a canonical registry of queue names","Use updateQueue for changes to existing queues"],"tags":["duplicate","queue","conflict"],"backgroundTag":"file-already-exists","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"}