{"id":23322,"library":"awsretry","title":"awsretry","description":"A decorator for AWS Boto3 calls that automatically retries on eventual consistency errors. Version 1.0.2 is current; release cadence is low (last release Apr 2019).","status":"active","version":"1.0.2","language":"python","source_language":"en","source_url":"https://github.com/linuxdynasty/awsretry","tags":["aws","boto3","retry","decorator"],"install":[{"cmd":"pip install awsretry","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"AWS SDK used for API calls","package":"boto3","optional":false}],"imports":[{"note":"Standard import path.","symbol":"AWSRetry","correct":"from awsretry import AWSRetry"},{"note":"backoff is a decorator factory, call it to get the decorator.","symbol":"backoff","correct":"from awsretry import backoff\n@backoff()"}],"quickstart":{"code":"import boto3\nfrom awsretry import AWSRetry\n\n@AWSRetry.backoff()\ndef describe_instance(instance_id):\n    client = boto3.client('ec2', region_name='us-east-1')\n    return client.describe_instances(InstanceIds=[instance_id])\n\ndescribe_instance('i-12345678')","lang":"python","description":"Decorate a Boto3 call to retry on AWS eventual consistency errors."},"warnings":[{"fix":"If you need retry on other errors, consider using botocore's built-in retry mode or tenacity.","message":"The library only retries on specific error codes related to eventual consistency (e.g., 'Throttling', 'RequestLimitExceeded'). It does not retry on all boto3 exceptions.","severity":"gotcha","affected_versions":"all"},{"fix":"Prefer using botocore's retry configuration: boto3.client('ec2', config=Config(retries={'max_attempts': 10, 'mode': 'adaptive'}))","message":"The library has not been updated since 2019. Boto3's built-in retry behavior (via botocore config) has improved significantly.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Ensure decorated function is synchronous and returns a boto3 API call result.","message":"The decorator must be applied to a function that returns a boto3 service response directly; it does not support async functions.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use @AWSRetry.backoff() (with parentheses) to invoke the backoff factory. Incorrect: 'from awsretry import backoff; @backoff'.","cause":"Importing backoff directly instead of as a method on AWSRetry, or missing parentheses when calling the decorator.","error":"AttributeError: module 'awsretry' has no attribute 'backoff'"},{"fix":"Correct usage: from awsretry import AWSRetry; @AWSRetry.backoff()","cause":"Trying to call the backoff module directly without using the AWSRetry class.","error":"TypeError: 'module' object is not callable"},{"fix":"Use a more general retry library (e.g., tenacity) or handle 404 separately.","cause":"The decorator only retries on specific error codes like 'Throttling' or 'RequestLimitExceeded'. For 404 errors (e.g., resource not found), it does not retry.","error":"botocore.exceptions.ClientError: An error occurred (404) when calling the ... operation: The specified ... does not exist."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}