- Newest
- Most votes
- Most comments
This turned out to be a Docker Desktop issue. You can work around it by using an older version of Docker Desktop, 4.5.0 (Mac) or 4.5.1 (Win).
The error you are getting is not throttling. Throttling would throw a ThrottlingException or Rate Exceeded error not connect timeout. Connect timeout seems network related, Are you using any proxy server or bastion to connect to the SSM endpoint which might be getting overloaded. This also explains why issue only occurs on home network because if it were throttling the ECS tasks would experience the same
Even though I don't believe the issue is throttling you should be doing both the things you have tried to avoid throttling issues in future.
Reducing the number of calls - I additionally evaluate which parameters can be loaded once when the container starts as opposed to being loaded multiple time
Set the retry and backoff parameters which make sense for your application, eg how long do you want retries to occur both an error should be thrown
I had a similar issue with SSM timing out (specifically in AWS Govcloud when trying to access a ParameterStore entry that didn't exist) when running within a Lambda. Modifying the boto_config to increase the number of retries as well as the retry mode appears to have resolved what was a consistent issue and did not lead to a notably longer runtime.
from botocore.config import Config
config = Config(retries={"max_attempts": 10, "mode": "adaptive"})
region = "us-gov-west-1"
ssm = boto3.client( service_name="ssm", region_name=region, config=config)
parameter_response = ssm.get_parameter(Name="redacted")
Relevant content
- Accepted Answerasked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 10 months ago
Thank you for the suggestions! To answer your questions:
The only options I see in the
retries
dictionary aremode
andmax_attempts
, nothing about backoff. Is there another place to configure that?I found this boto3 bug on GitHub that suggested
boto3.set_stream_logger('')
as a way to get verbose logging of what's happening with connections and retries, so I've added that into my application. It really is very verbose, so I'm hoping I don't have to leave it on very long, LOL!Would appreciate your thoughts given the new info added to the question, @Peter_G.