{"record":{"id":"8432f7a20bba3d07","repo":"apache/rocketmq","slug":"create-user-to-rocksdb-failed","errorCode":null,"errorMessage":"create user to RocksDB failed","messagePattern":"create user to RocksDB failed","errorType":"exception","errorClass":"AuthenticationException","httpStatus":null,"severity":"error","filePath":"auth/src/main/java/org/apache/rocketmq/auth/authentication/provider/LocalAuthenticationMetadataProvider.java","lineNumber":84,"sourceCode":"\n        this.userCache = Caffeine.newBuilder()\n            .maximumSize(authConfig.getUserCacheMaxNum())\n            .expireAfterAccess(authConfig.getUserCacheExpiredSecond(), TimeUnit.SECONDS)\n            .refreshAfterWrite(authConfig.getUserCacheRefreshSecond(), TimeUnit.SECONDS)\n            .executor(cacheRefreshExecutor)\n            .build(new UserCacheLoader(this.storage));\n    }\n\n    @Override\n    public CompletableFuture<Void> createUser(User user) {\n        try {\n            byte[] keyBytes = user.getUsername().getBytes(StandardCharsets.UTF_8);\n            byte[] valueBytes = JSON.toJSONBytes(user);\n            this.storage.put(AUTH_METADATA_COLUMN_FAMILY, keyBytes, keyBytes.length, valueBytes);\n            this.storage.flushWAL();\n            this.userCache.invalidate(user.getUsername());\n        } catch (Exception e) {\n            throw new AuthenticationException(\"create user to RocksDB failed\", e);\n        }\n        return CompletableFuture.completedFuture(null);\n    }\n\n    @Override\n    public CompletableFuture<Void> deleteUser(String username) {\n        try {\n            this.storage.delete(AUTH_METADATA_COLUMN_FAMILY, username.getBytes(StandardCharsets.UTF_8));\n            this.storage.flushWAL();\n            this.userCache.invalidate(username);\n        } catch (Exception e) {\n            throw new AuthenticationException(\"delete user from RocksDB failed\", e);\n        }\n        return CompletableFuture.completedFuture(null);\n    }\n\n    @Override\n    public CompletableFuture<Void> updateUser(User user) {","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/rocketmq/blob/293f5885719fc4aa3619446a1900f58ccfcfdd29/auth/src/main/java/org/apache/rocketmq/auth/authentication/provider/LocalAuthenticationMetadataProvider.java#L66-L102","documentation":"Error \"create user to RocksDB failed\" thrown in apache/rocketmq.","triggerScenarios":"Occurs when creating a user in the local RocksDB-backed authentication metadata store fails, typically due to RocksDB being locked/corrupted, disk I/O errors, or insufficient permissions on the data directory.","commonSituations":"RocksDB directory locked by another broker process; disk full or I/O error; corrupted RocksDB files; missing write permissions on the configured store path.","solutions":["Verify the RocksDB instance used for auth_user is opened and healthy before creating users; check broker logs for RocksDB lock or corruption errors.","Ensure the data directory for authentication metadata is writable and not occupied by another broker process.","Retry the createUser operation after fixing the underlying RocksDB failure; if corruption persists, restore or rebuild the metadata store."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"293f5885719fc4aa3619446a1900f58ccfcfdd29","analyzedAt":"2026-08-14T11:50:13.822Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}