You must not specify both region and endpoint – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.4-7.17

Briefly, this error occurs when you’re configuring Elasticsearch AWS settings and you specify both the ‘region’ and ‘endpoint’ parameters. These parameters are mutually exclusive, meaning you should only use one or the other. To resolve this issue, you can either remove the ‘region’ parameter if you want to use a specific ‘endpoint’, or remove the ‘endpoint’ parameter if you want to use a ‘region’. Make sure to save your changes and restart Elasticsearch for the changes to take effect.

This guide will help you check for common problems that cause the log ” you must not specify both region and endpoint ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: .

Log Context

Log “you must not specify both region and endpoint” class name is CleanupS3RepositoryCommand.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 if (Strings.isNullOrEmpty(region) && Strings.isNullOrEmpty(endpoint)) {
 throw new ElasticsearchException("region or endpoint option is required for cleaning up S3 repository");
 }  if (Strings.isNullOrEmpty(region) == false && Strings.isNullOrEmpty(endpoint) == false) {
 throw new ElasticsearchException("you must not specify both region and endpoint");
 }  String accessKey = accessKeyOption.value(options);
 if (Strings.isNullOrEmpty(accessKey)) {
 throw new ElasticsearchException("access_key option is required for cleaning up S3 repository");

 

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?