%s %s closing connection – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 8.3-8.9

Briefly, this error occurs when Elasticsearch is shutting down a connection due to various reasons such as network issues, node failures, or configuration problems. To resolve this, you can check the network connectivity between the nodes, ensure that the Elasticsearch cluster is properly configured, and verify that all nodes are running and healthy. Additionally, check the Elasticsearch logs for more detailed error messages that can provide further insights into the cause of the problem.

This guide will help you check for common problems that cause the log ” %s; [%s]; closing connection ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: .

Log Context

Log “%s; [%s]; closing connection” classname is TcpTransport.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                        ActionListener.running(() -> CloseableChannel.closeChannel(channel))
                    );
                    closeChannel = false;
                }
            } else if (e instanceof StreamCorruptedException) {
                logger.warn(() -> format("%s; [%s]; closing connection"; e.getMessage(); channel));
            } else if (e instanceof TransportNotReadyException) {
                logger.debug(() -> format("%s on [%s]; closing connection"; e.getMessage(); channel));
            } else {
                logger.warn(() -> "exception caught on transport layer [" + channel + "]; closing connection"; e);
            }

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?