apache/rocketmq · error · AuthenticationException

delete user from RocksDB failed

Error message

delete user from RocksDB failed

What it means

Error "delete user from RocksDB failed" thrown in apache/rocketmq.

Source

Thrown at auth/src/main/java/org/apache/rocketmq/auth/authentication/provider/LocalAuthenticationMetadataProvider.java:96

            byte[] keyBytes = user.getUsername().getBytes(StandardCharsets.UTF_8);
            byte[] valueBytes = JSON.toJSONBytes(user);
            this.storage.put(AUTH_METADATA_COLUMN_FAMILY, keyBytes, keyBytes.length, valueBytes);
            this.storage.flushWAL();
            this.userCache.invalidate(user.getUsername());
        } catch (Exception e) {
            throw new AuthenticationException("create user to RocksDB failed", e);
        }
        return CompletableFuture.completedFuture(null);
    }

    @Override
    public CompletableFuture<Void> deleteUser(String username) {
        try {
            this.storage.delete(AUTH_METADATA_COLUMN_FAMILY, username.getBytes(StandardCharsets.UTF_8));
            this.storage.flushWAL();
            this.userCache.invalidate(username);
        } catch (Exception e) {
            throw new AuthenticationException("delete user from RocksDB failed", e);
        }
        return CompletableFuture.completedFuture(null);
    }

    @Override
    public CompletableFuture<Void> updateUser(User user) {
        try {
            byte[] keyBytes = user.getUsername().getBytes(StandardCharsets.UTF_8);
            byte[] valueBytes = JSON.toJSONBytes(user);
            this.storage.put(AUTH_METADATA_COLUMN_FAMILY, keyBytes, keyBytes.length, valueBytes);
            this.storage.flushWAL();
            this.userCache.invalidate(user.getUsername());
        } catch (Exception e) {
            throw new AuthenticationException("update user to RocksDB failed", e);
        }
        return CompletableFuture.completedFuture(null);
    }

View on GitHub (pinned to 293f588571)

Solutions

  1. Confirm the user exists in the auth_user RocksDB store before attempting deletion.
  2. Check that the RocksDB directory is writable and not locked by another process.
  3. Inspect broker logs for the underlying RocksDB exception and retry the deleteUser operation.

When it happens

Trigger: Occurs when deleting a user from the local RocksDB-backed authentication metadata store fails.

Common situations: RocksDB write failure due to lock contention, disk errors, or corruption; attempting to delete while the store is unavailable.


AI-assisted analysis of apache/rocketmq@293f588571 (2026-08-14). Data as JSON: /api/errors/45d11528197405d7. Report an issue: GitHub.