Setting is set but and are not – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-7.15

Briefly, this error occurs when a specific setting in Elasticsearch is enabled, but the other necessary settings that should be enabled with it are not. This could lead to inconsistencies and unexpected behavior in the system. To resolve this issue, you should check your Elasticsearch configuration and ensure that all necessary settings are correctly enabled. If you’re unsure about which settings should be enabled, refer to the Elasticsearch documentation or seek advice from an Elasticsearch expert.

This guide will help you check for common problems that cause the log ” Setting [{}] is set but [{}] and [{}] are not ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugins, discovery, discovery-ec2.

Log Context

Log “Setting [{}] is set but [{}] and [{}] are not” class name is Ec2ClientSettings.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 try (SecureString key = ACCESS_KEY_SETTING.get(settings);
 SecureString secret = SECRET_KEY_SETTING.get(settings);
 SecureString sessionToken = SESSION_TOKEN_SETTING.get(settings)) {
 if (key.length() == 0 && secret.length() == 0) {
 if (sessionToken.length() > 0) {
 throw new SettingsException("Setting [{}] is set but [{}] and [{}] are not";
 SESSION_TOKEN_SETTING.getKey(); ACCESS_KEY_SETTING.getKey(); SECRET_KEY_SETTING.getKey());
 }  logger.debug("Using either environment variables; system properties or instance profile credentials");
 return null;

 

 [ratemypost]