CPM may fail to communicate with AWS gateways with the timed out error

CPM may fail to communicate with AWS gateways with the "timed out" error

CPM may fail to communicate with AWS gateways with the "timed out" error during various operations:

ERROR:  run_snapshots(.\cpmagent\agent.py:1462)  snapshot of policy PolicyName, volume: vol-0123456789abcdef failed (independent). Reason: timed out
..
ERROR:  wait_for_snapshots(.\cpmagent\agent.py:514)  ec2, Policy 4, error in 'get_all_snapshots()': timed out
...
ERROR:  run_snapshots(.\cpmagent\agent.py:1179)  (instance: i-0123456789abcdef) could not get object from aws. Reason: timed out Exception: timed out
...
ERROR:  handle_boto3_error_exception(.\common\aws_utils.py:514)  Unknown Exception: 'NoneType' object has no attribute '__getitem__' (original: HTTPSConnectionPool(host='ec2.us-west-1.amazonaws.com', port=443): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<botocore.awsrequest.AWSHTTPSConnection object at 0x7fc0e3d37350>, 'Connection to ec2.us-west-1.amazonaws.com timed out. (connect timeout=60)')))
...
ERROR:  delete_all_snapshots_of_a_backup_record(.\cpmserver\cpm\aws_utils.py:432)  Failed to delete snapshot snap-abcdef0123456789 (policy PolicyName), delete operation failed. Reason: timed out (error: None)

This is an indication that CPM instance can't reliably communicate with AWS gateways, most likely due to a slow/misconfigured proxy/firewall/NAT gateway etc. For troubleshooting purposes, you may switch to a direct connection - CPM will be able to operate normally.