{"record":{"id":"87850f1fac537d7e","repo":"apache/rocketmq","slug":"the-user-is-not-exist-87850f","errorCode":null,"errorMessage":"The user is not exist","messagePattern":"The user is not exist","errorType":"exception","errorClass":"AuthenticationException","httpStatus":null,"severity":"error","filePath":"broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java","lineNumber":3296,"sourceCode":"            response.setCode(ResponseCode.INVALID_PARAMETER);\n            response.setRemark(\"The username is blank\");\n            return response;\n        }\n\n        UserInfo userInfo = RemotingSerializable.decode(request.getBody(), UserInfo.class);\n        userInfo.setUsername(requestHeader.getUsername());\n        User user = UserConverter.convertUser(userInfo);\n\n        if (user.getUserType() == UserType.SUPER && isNotSuperUserLogin(request)) {\n            response.setCode(ResponseCode.SYSTEM_ERROR);\n            response.setRemark(\"The super user can only be update by super user\");\n            return response;\n        }\n\n        this.brokerController.getAuthenticationMetadataManager().getUser(requestHeader.getUsername())\n            .thenCompose(old -> {\n                if (old == null) {\n                    throw new AuthenticationException(\"The user is not exist\");\n                }\n                if (old.getUserType() == UserType.SUPER && isNotSuperUserLogin(request)) {\n                    throw new AuthenticationException(\"The super user can only be update by super user\");\n                }\n                return this.brokerController.getAuthenticationMetadataManager().updateUser(user);\n            }).thenAccept(nil -> response.setCode(ResponseCode.SUCCESS))\n            .exceptionally(ex -> {\n                LOGGER.error(\"update user {} error\", requestHeader.getUsername(), ex);\n                return handleAuthException(response, ex);\n            })\n            .join();\n        return response;\n    }\n\n    private RemotingCommand deleteUser(ChannelHandlerContext ctx,\n        RemotingCommand request) throws RemotingCommandException {\n        final RemotingCommand response = RemotingCommand.createResponseCommand(null);\n","sourceCodeStart":3278,"sourceCodeEnd":3314,"githubUrl":"https://github.com/apache/rocketmq/blob/293f5885719fc4aa3619446a1900f58ccfcfdd29/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java#L3278-L3314","documentation":"Update-user admin handler: the async chain loads the existing user by username via AuthenticationMetadataManager.getUser() and throws AuthenticationException('The user is not exist') when it returns null. It means an UPDATE_USER request targeted a username that does not exist in the broker's authentication metadata.","triggerScenarios":"UpdateUserRequest with a username never created (typo, deleted earlier, or created on a different broker/ACL metadata store); metadata not yet replicated to this broker.","commonSituations":"Scripts that update users assuming they exist; user was deleted by another operator; in clustered deployments, the authentication metadata (JWT provider / ACL manager) not synced; case-mismatch in username.","solutions":["Create the user first with CreateUserRequest (createUser), then issue the update.","Verify the exact username with getUser / listUsers against the same broker before updating.","If using an external authentication metadata manager, confirm it is connected and the user record is visible on this broker."],"exampleFix":"// before\nUpdateUserRequestHeader h = new UpdateUserRequestHeader();\nh.setUsername(\"operator1\"); // never created -> AuthenticationException\n\n// after\n// 1. create, then update\nCreateUserRequestHeader c = new CreateUserRequestHeader();\nc.setUsername(\"operator1\");\n// ... send CREATE_USER first, then UPDATE_USER","handlingStrategy":"validation","validationCode":"CompletableFuture<User> existing = authMetadataManager.getUser(username);\nif (existing.join() == null) { /* createUser(...) instead of updateUser */ }","typeGuard":null,"tryCatchPattern":"catch (CompletionException e) { if (e.getCause() instanceof AuthenticationException && e.getCause().getMessage().contains(\"not exist\")) { createUser(); return; } throw e; }","preventionTips":["Pre-check with getUser before updateUser.","Treat update of a missing user as create in idempotent provisioning scripts."],"tags":["rocketmq","broker","acl","user-management","authentication","admin-api"],"backgroundTag":null,"analyzedSha":"293f5885719fc4aa3619446a1900f58ccfcfdd29","analyzedAt":"2026-08-14T11:50:13.822Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}