{"record":{"id":"f676a88dcc7da650","repo":"apache/dolphinscheduler","slug":"queue-not-exist","errorCode":"QUEUE_NOT_EXIST","errorMessage":"QUEUE_NOT_EXIST: queue {queue} does not exist","messagePattern":"QUEUE_NOT_EXIST: queue (.+?) does not exist","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java","lineNumber":95,"sourceCode":"            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\n        else if (StringUtils.isEmpty(updateQueue.getQueue())) {\n            throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR, Constants.QUEUE);\n        } else if (StringUtils.isEmpty(updateQueue.getQueueName())) {\n            throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR, Constants.QUEUE_NAME);\n        } else if (!Objects.equals(updateQueue.getQueue(), existsQueue.getQueue())\n                && checkQueueExist(updateQueue.getQueue())) {\n            throw new ServiceException(Status.QUEUE_VALUE_EXIST, updateQueue.getQueue());\n        } else if (!Objects.equals(updateQueue.getQueueName(), existsQueue.getQueueName())\n                && checkQueueNameExist(updateQueue.getQueueName())) {\n            throw new ServiceException(Status.QUEUE_NAME_EXIST, updateQueue.getQueueName());\n        }\n    }\n\n    /**","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/QueueServiceImpl.java#L77-L113","documentation":"QUEUE_NOT_EXIST is thrown by updateQueueValid() when the existsQueue argument is null, meaning the queue targeted for update was not found in storage. updateQueue() looks up the existing record first and passes null when absent. The update is aborted to avoid updating a phantom record.","triggerScenarios":"Calling updateQueue with a queue id/name that no longer exists; stale UI page holding a queue deleted by another user; wrong id typed into an API script.","commonSituations":"Concurrent deletion between listing and updating; environment sync where ids differ between dev and prod; updates issued after a queue was removed during cleanup.","solutions":["Re-fetch the queue list and confirm the target exists","Create the queue instead if it should exist","Catch ServiceException with Status.QUEUE_NOT_EXIST and reconcile state"],"exampleFix":"// before\nqueueService.updateQueue(loginUser, missingId, \"default\", \"DefaultQueue\");\n// after\nMap<String, Object> check = queueService.queryQueue(loginUser, missingId);\nif (Status.SUCCESS.getCode() == (int) check.get(Constants.STATUS)) {\n    queueService.updateQueue(loginUser, missingId, \"default\", \"DefaultQueue\");\n}","handlingStrategy":"validation","validationCode":"Queue existing = queueMapper.selectById(id);\nif (existing == null) {\n    throw new IllegalStateException(\"Queue \" + id + \" does not exist; cannot update\");\n}","typeGuard":"boolean queueExists(Queue q) { return q != null && q.getId() != null; }","tryCatchPattern":"try {\n    queueService.updateQueue(loginUser, id, queue, queueName);\n} catch (ServiceException e) {\n    if (e.getCode() == Status.QUEUE_NOT_EXIST.getCode()) { /* re-sync or create */ }\n    throw e;\n}","preventionTips":["Re-fetch queues before updating rather than trusting stale ids","Handle concurrent deletion gracefully","Use verifyQueue/query before mutations"],"tags":["not-found","queue","update"],"backgroundTag":"entity-not-found","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"}