Host is missing in HTTPS URI uriString – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 8.2-8.9

Briefly, this error occurs when the URI (Uniform Resource Identifier) for the Elasticsearch instance is missing the host part in the HTTPS request. This could be due to a misconfiguration in the Elasticsearch settings. To resolve this issue, you should check the Elasticsearch configuration file (elasticsearch.yml) and ensure that the correct host is specified in the URI. Also, verify that the URI is correctly formatted, starting with ‘https://’ followed by the host and port number. If you’re using a cluster, ensure all nodes have the correct URI.

This guide will help you check for common problems that cause the log ” Host is missing in HTTPS URI [” + uriString + “]. ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “Host is missing in HTTPS URI [” + uriString + “].” class name is JwtUtil.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 } catch (Exception e) {
 throw new SettingsException("Failed to parse HTTPS URI [" + uriString + "]."; e);
 }
 if (Strings.hasText(uri.getHost()) == false) {
 // Example URIs w/o host: "https:/"; "https://"; "https://:443"
 throw new SettingsException("Host is missing in HTTPS URI [" + uriString + "].");
 }
 return uri;
 } else if (uriString.startsWith("http")) {
 throw new SettingsException("Not allowed to use HTTP URI [" + uriString + "]. Only HTTPS is supported.");
 } else {

 

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?