Cannot send message event loop is shutting down – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-8.8

Briefly, this error occurs when an attempt is made to send a message or perform an operation while the event loop, which handles asynchronous tasks in Elasticsearch, is in the process of shutting down. This could be due to an abrupt termination or a system error. To resolve this issue, you can try restarting Elasticsearch, ensuring that all tasks are completed before shutting down the event loop, or debugging to identify and fix any system errors that may be causing the event loop to shut down prematurely.

This guide will help you check for common problems that cause the log ” Cannot send message; event loop is shutting down. ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: .

Log Context

Log “Cannot send message; event loop is shutting down.” class name is We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 public void sendMessage(BytesReference reference; ActionListener listener) {
 channel.writeAndFlush(Netty4Utils.toByteBuf(reference); addPromise(listener; channel));  if (channel.eventLoop().isShutdown()) {
 listener.onFailure(new TransportException("Cannot send message; event loop is shutting down."));
 }  public Channel getNettyChannel() {
 return channel;