Both an endpoint suffix as well as a primary endpoint were set – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 8.8-8.9

Briefly, this error occurs when both an endpoint suffix and a primary endpoint are configured in Elasticsearch. This is a configuration issue, as Elasticsearch expects only one of these to be set. To resolve this, you can either remove the endpoint suffix or the primary endpoint from your configuration. Make sure to keep the one that is necessary for your specific use case. Also, ensure that the remaining endpoint is correctly configured to avoid further issues.

This guide will help you check for common problems that cause the log ” Both an endpoint suffix as well as a primary endpoint were set ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: azure, repository-azure, repositories.

Log Context

Log “Both an endpoint suffix as well as a primary endpoint were set” class name is AzureStorageSettings.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 final boolean hasEndpointSuffix = Strings.hasText(endpointSuffix);
 final boolean hasEndpoint = Strings.hasText(endpoint);
 final boolean hasSecondaryEndpoint = Strings.hasText(secondaryEndpoint);  if (hasEndpointSuffix && hasEndpoint) {
 throw new SettingsException("Both an endpoint suffix as well as a primary endpoint were set");
 }  if (hasEndpointSuffix && hasSecondaryEndpoint) {
 throw new SettingsException("Both an endpoint suffix as well as a secondary endpoint were set");
 }

 

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?