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

Opster Team

August-23, Version: 8.8-8.9

Briefly, this error occurs when there is a configuration issue in Elasticsearch where both an endpoint suffix and a secondary endpoint are set simultaneously. This is not allowed as it can cause conflicts in routing requests. To resolve this issue, you can either remove the endpoint suffix or the secondary endpoint from your configuration. Ensure that only one is set at a time. Alternatively, you can check your application’s code to ensure it’s not setting both parameters simultaneously.

This guide will help you check for common problems that cause the log ” Both an endpoint suffix as well as a secondary 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 secondary endpoint were set” class name is AzureStorageSettings.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 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");
 }  if (hasEndpoint == false && hasSecondaryEndpoint) {
 throw new SettingsException("A primary endpoint is required when setting a secondary endpoint");
 }

 

 [ratemypost]