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");