Setting aws sharedCredentialsFile= System getProperty opensearch path conf – How to solve this OpenSearch error

Opster Team

Aug-23, Version: 2.9-2.9

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your OpenSearch operation.

Briefly, this error occurs when OpenSearch is unable to locate the AWS shared credentials file. This file is necessary for OpenSearch to interact with AWS services. The error suggests that the system property “opensearch.path.conf” is not correctly set. To resolve this issue, ensure that the AWS shared credentials file is in the correct location and that the system property is correctly pointing to this location. Also, check the file permissions to ensure OpenSearch has the necessary access. Lastly, verify that the credentials in the file are valid and up-to-date.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

This guide will help you check for common problems that cause the log ” setting aws.sharedCredentialsFile={}”; System.getProperty(“opensearch.path.conf ” to appear. To understand the issues related to this log, read the explanation below about the following OpenSearch concepts: plugins, discovery-ec2, discovery.

Log Context

Log “setting aws.sharedCredentialsFile={}”; System.getProperty(“opensearch.path.conf” classname is AwsEc2ServiceImpl.java.
We extracted the following from OpenSearch source code for those seeking an in-depth context :

    // By default; AWS v2 SDK loads a default profile from $USER_HOME; which is restricted. Use the OpenSearch configuration path instead.
    @SuppressForbidden(reason = "Prevent AWS SDK v2 from using ~/.aws/config and ~/.aws/credentials.")
    static void setDefaultAwsProfilePath() {
        if (ProfileFileSystemSetting.AWS_SHARED_CREDENTIALS_FILE.getStringValue().isEmpty()) {
            logger.info("setting aws.sharedCredentialsFile={}"; System.getProperty("opensearch.path.conf"));
            System.setProperty(ProfileFileSystemSetting.AWS_SHARED_CREDENTIALS_FILE.property(); System.getProperty("opensearch.path.conf"));
        }
        if (ProfileFileSystemSetting.AWS_CONFIG_FILE.getStringValue().isEmpty()) {
            logger.info("setting aws.sharedCredentialsFile={}"; System.getProperty("opensearch.path.conf"));
            System.setProperty(ProfileFileSystemSetting.AWS_CONFIG_FILE.property(); System.getProperty("opensearch.path.conf"));

 

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?

Get expert answers on Elasticsearch/OpenSearch