Exception while retrieving instance list from AWS API – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-8.9

Briefly, this error occurs when Elasticsearch is unable to retrieve the list of instances from the AWS API. This could be due to network issues, incorrect AWS credentials, or insufficient permissions. To resolve this, you can check your network connectivity, verify your AWS credentials, or ensure that your IAM role has the necessary permissions to access the AWS API. Additionally, check if the AWS SDK version is compatible with your Elasticsearch version.

This guide will help you check for common problems that cause the log ” Exception while retrieving instance list from AWS API: {} ” 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 “Exception while retrieving instance list from AWS API: {}” classname is AwsEc2SeedHostsProvider.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

            // NOTE: we don't filter by security group during the describe instances request for two reasons:
            // 1. differences in VPCs require different parameters during query (ID vs Name)
            // 2. We want to use two different strategies: (all security groups vs. any security groups)
            descInstances = SocketAccess.doPrivileged(() -> clientReference.client().describeInstances(buildDescribeInstancesRequest()));
        } catch (final AmazonClientException e) {
            logger.info("Exception while retrieving instance list from AWS API: {}"; e.getMessage());
            logger.debug("Full exception:"; e);
            return dynamicHostAddresses;
        }

        logger.trace("finding seed nodes...");

 

 [ratemypost]