How To Solve Issues Related to Log – EC2 API request failed; retry again. Reason was:

How To Solve Issues Related to Log – EC2 API request failed; retry again. Reason was:

Updated: Jan-20

Elasticsearch Version: 1.7-8.0

Background

Before you begin reading this guide try our beta Elasticsearch Health Check-Up it analyses JSON’s to provide personalized recommendations that can improve your clusters performance.


To troubleshoot log “EC2 API request failed; retry again. Reason was:” it’s important to understand a few problems related to Elasticsearch concepts cloud-aws, discovery, discovery-ec2, plugins, request. See bellow important tips and explanations on these concepts

Log Context

Log”EC2 API request failed; retry again. Reason was:” classname is AwsEc2ServiceImpl.java
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

         final Random rand = Randomness.get();
        final RetryPolicy retryPolicy = new RetryPolicy(
            RetryPolicy.RetryCondition.NO_RETRY_CONDITION;
            (originalRequest; exception; retriesAttempted) -> {
               // with 10 retries the max delay time is 320s/320000ms (10 * 2^5 * 1 * 1000)
               logger.warn("EC2 API request failed; retry again. Reason was:"; exception);
               return 1000L * (long) (10d * Math.pow(2; retriesAttempted / 2.0d) * (1.0d + rand.nextDouble()));
            };
            10;
            false);
        clientConfiguration.setRetryPolicy(retryPolicy);




Related issues to this log

We have gathered selected Q&A from the community and issues from Github, that can help fix related issues please review the following for further information :

1 X Retries Exceeded With Url In Requ  

Github Issue Number 28452  

About Opster

Opster detects root causes of Elasticsearch problems, provides automated recommendations and can perform various actions to prevent issues and optimize performance

Find Configuration Errors

Analyze Now