From b850747fca1660407bd465ff19e02d8f962b1c14 Mon Sep 17 00:00:00 2001 From: Peter Gyori Date: Fri, 6 Feb 2026 18:49:45 +0100 Subject: [PATCH] ZOOKEEPER-5019: Improve the error message when the message sent by a client is malformed --- .../main/java/org/apache/zookeeper/server/NIOServerCnxn.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/NIOServerCnxn.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/NIOServerCnxn.java index d35cf97edad..dc185fb8f8f 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/NIOServerCnxn.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/NIOServerCnxn.java @@ -566,7 +566,9 @@ private boolean readLength(SelectionKey k) throws IOException { throw new IOException("Len error. " + "A message from " + this.getRemoteSocketAddress() + " with advertised length of " + len + " is either a malformed message or too large to process" - + " (length is greater than jute.maxbuffer=" + BinaryInputArchive.maxBuffer + ")"); + + " (length is greater than jute.maxbuffer=" + BinaryInputArchive.maxBuffer + ")." + + " Note: If the length appears unusually large," + + " this may be a TLS/SSL connection attempt on a non-secure port."); } if (!isZKServerRunning()) { throw new IOException("ZooKeeperServer not running");