Watch attachment HTTP empty response body host port – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-7.15

Briefly, this error occurs when Elasticsearch’s Watcher feature tries to execute an HTTP request but receives an empty response. This could be due to network issues, incorrect configuration, or the target server not returning any data. To resolve this, you can check the network connectivity, verify the configuration of the Watcher, and ensure the target server is functioning correctly and returning the expected data.

This guide will help you check for common problems that cause the log ” Watch[{}] attachment[{}] HTTP empty response body host[{}]; port[{}]; ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, response.

Log Context

Log “Watch[{}] attachment[{}] HTTP empty response body host[{}]; port[{}];” class name is We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 String contentType = attachment.getContentType();
 String attachmentContentType = Strings.hasLength(contentType) ? contentType : response.contentType();
 return new Attachment.Bytes(; BytesReference.toBytes(response.body()); attachmentContentType;
 } else {
 throw new ElasticsearchException("Watch[{}] attachment[{}] HTTP empty response body host[{}]; port[{}]; " +
 "method[{}]; path[{}]; status[{}]";;;; httpRequest.port(); httpRequest.method();
 httpRequest.path(); response.status());
 } else {