ZooKeeper client error in Ranger RAZ
This document addresses a ZooKeeper client-side error encountered within the Apache Ranger RAZ (Ranger Authorization Service) environment. The issue arises from a buffer size mismatch between the ZooKeeper server and the Ranger RAZ client during large data transfers.
[zkNettyNioEventLoopGroup-3-1]: Unexpected throwable
java.io.IOException: Packet len 1051047 is out of range!
at org.apache.zookeeper.ClientCnxnSocket.readLength(ClientCnxnSocket.java:121) ~[zookeeper.jar:3.8.1.7.2.18.500-61]
at org.apache.zookeeper.ClientCnxnSocketNetty$ZKClientHandler.channelRead0(ClientCnxnSocketNetty.java:509) ~[zookeeper.jar:3.8.1.7.2.18.500-61]The root cause is an insufficient client-side buffer size configured within the Apache Ranger RAZ client's ZooKeeper Curator framework.
-
Default limit mismatch: By default, Apache Ranger RAZ initializes its ZooKeeper client buffer (
jute.maxbuffer) to 1MB. However, the ZooKeeper server ensemble in this environment is configured to handle up to 4MB packets. -
Environment-specific payload: This issue is highly dependent on the specific environment's data volume (for example, highly complex security policies, large numbers of tokens, or extensive directory structures). Because the payload size fluctuates based on the environment, the issue could not be replicated in standard internal testing environments.
-
The failure mechanism: When Ranger RAZ attempts to read or write data packets exceeding 1MB, the underlying Apache Curator framework rejects the packet, resulting in an immediate connection or serialization failure.
To resolve this issue, the client-side buffer size must be increased to align precisely with the ZooKeeper server's maximum packet limit.
