Handshake failed because connection reset – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-8.9

Briefly, this error occurs when Elasticsearch is unable to establish a connection due to a network interruption or a problem with the target server. This could be due to network instability, firewall restrictions, or the target server being overloaded or unresponsive. To resolve this issue, you can check the network connection, ensure the target server is running and not overloaded, and verify that there are no firewall restrictions blocking the connection. Additionally, you can also check the Elasticsearch logs for more detailed information about the error.

This guide will help you check for common problems that cause the log ” handshake failed because connection reset ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: .

Log Context

Log “handshake failed because connection reset” class name is TransportHandshaker.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 ) {
 numHandshakes.inc();
 final HandshakeResponseHandler handler = new HandshakeResponseHandler(requestId; listener);
 pendingHandshakes.put(requestId; handler);
 channel.addCloseListener(
 ActionListener.running(() -> handler.handleLocalException(new TransportException("handshake failed because connection reset")))
 );
 boolean success = false;
 try {
 handshakeRequestSender.sendRequest(node; channel; requestId; REQUEST_HANDSHAKE_VERSION);

 

 [ratemypost]