java.lang.IllegalArgumentException: unknown communications mode
search cancel

java.lang.IllegalArgumentException: unknown communications mode

book

Article ID: 294353

calendar_today

Updated On:

Products

VMware Tanzu Gemfire

Issue/Introduction

You may see the below warning messages in the cacheserver's log after upgrading a GemFire cluster:
2020-08-17 21:17:35,445 48995492 [ServerConnection on port 40404 Thread 8] WARN  org.apache.geode.internal.cache.tier.sockets.ServerConnection [] - Server connection from [gateway host address=172.138.104.144; gateway port=41072]: Received no handshake reply code
java.io.IOException: HandShake reply code is not ok
	at org.apache.geode.internal.cache.tier.sockets.ServerSideHandshakeImpl.<init>(ServerSideHandshakeImpl.java:81) ~[geode-core-9.8.4.jar:?]
	at org.apache.geode.internal.cache.tier.sockets.ServerSideHandshakeFactory.readHandshake(ServerSideHandshakeFactory.java:56) ~[geode-core-9.8.4.jar:?]
	at org.apache.geode.internal.cache.tier.sockets.ServerConnection.verifyClientConnection(ServerConnection.java:324) ~[geode-core-9.8.4.jar:?]
	at org.apache.geode.internal.cache.tier.sockets.ServerConnection.doHandshake(ServerConnection.java:750) ~[geode-core-9.8.4.jar:?]
	at org.apache.geode.internal.cache.tier.sockets.OriginalServerConnection.doOneMessage(OriginalServerConnection.java:71) ~[geode-core-9.8.4.jar:?]
	at org.apache.geode.internal.cache.tier.sockets.ServerConnection.run(ServerConnection.java:1230) ~[geode-core-9.8.4.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_201]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_201]
	at org.apache.geode.internal.cache.tier.sockets.AcceptorImpl.lambda$initializeServerConnectionThreadPool$3(AcceptorImpl.java:616) ~[geode-core-9.8.4.jar:?]
	at org.apache.geode.internal.logging.LoggingThreadFactory.lambda$newThread$0(LoggingThreadFactory.java:121) ~[geode-core-9.8.4.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
2020-08-17 21:17:35,540 48995587 [Handshaker exampleserver.com/192.168.30.19:40404 Thread 4] WARN  org.apache.geode.internal.cache.tier.sockets.AcceptorImpl [] - Error processing client connection
java.lang.IllegalArgumentException: unknown communications mode: 0
	at org.apache.geode.internal.cache.tier.CommunicationMode.fromModeNumber(CommunicationMode.java:164) ~[geode-core-9.8.4.jar:?]
	at org.apache.geode.internal.cache.tier.sockets.AcceptorImpl.getCommunicationModeForNonSelector(AcceptorImpl.java:1522) ~[geode-core-9.8.4.jar:?]
	at org.apache.geode.internal.cache.tier.sockets.AcceptorImpl.handleNewClientConnection(AcceptorImpl.java:1389) [geode-core-9.8.4.jar:?]
	at org.apache.geode.internal.cache.tier.sockets.AcceptorImpl$1.run(AcceptorImpl.java:1301) [geode-core-9.8.4.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
2020-08-17 21:17:35,541 48995588 [Handshaker exampleserver.com/192.168.30.19:40404 Thread 4] WARN  org.apache.geode.internal.cache.tier.sockets.AcceptorImpl [] - Cache server: failed accepting client connection java.io.EOFException
java.io.EOFException: null
	at org.apache.geode.internal.cache.tier.sockets.AcceptorImpl.handleNewClientConnection(AcceptorImpl.java:1397) ~[geode-core-9.8.4.jar:?]
	at org.apache.geode.internal.cache.tier.sockets.AcceptorImpl$1.run(AcceptorImpl.java:1301) [geode-core-9.8.4.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]


Environment

Product Version: 9.8

Resolution

There are two possibilities which could trigger these kinds of warning messages.

  • There are some connectivity issues between a Gateway Sender and Receiver during the handshake stage. You may need to confirm the Sender and Receiver's setup. Additionally, you should double check whether the Gateway Sender site's GemFire version is compatible with the Gateway Receiver site's GemFire version.
  • A GemFire Cacheserver will read the first byte of a "client" connection request including Gateway/Java Client/Native Client during the handshake stage to determine the communication mode and "client host"/"client port". If the connection request source is using an old GemFire version which is not compatible with the GemFire Cacheserver, and it may use the wrong communication mode, so the Cacheserver will consider it an incorrect connection source and throw an "IllegalArgumentException: unknown communications mode: XX" or "java.io.IOException: HandShake reply code is not ok" exception there. You can confirm the GemFire version in the connection request source host to make sure that this GemFire "Client" version has a compatibility with the GemFire Cacheserver version using the host address info in the log such as "host address=172.###.###.144".