WaiterError: Run Command Waiter not able to access command ID right after send_command is invoked.
See original GitHub issueDescribe the bug
Waiter unable to access SSM Run Command ID right after send_command is invoked. As a workaround, able to run without issues if sleep timer of 0.5-1 second is added or a looping in case of waiter error in try-except.
Steps to reproduce
response = client.send_command(Targets=[{"Key": "string", "Values": ["string"]}],
DocumentName="string", DocumentVersion="string")
commandID = response["Command"]["CommandId"]
waiter = client.get_waiter('command_executed')
waiter.wait(
CommandId=commandID ,
InstanceId='string',
PluginName='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
Expected behavior Use command ID to poll/wait until command is executed.
Debug logs {“errorMessage” : “CommandExecuted Failed” “errorType” : “WaiterError”}
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Retrieving command invocation in AWS SSM - Stack Overflow
from botocore.exceptions import WaiterError ssm_client = boto3.client( ... try: waiter.wait( CommandId=commands_id, InstanceId=instance_id, ) ...
Read more >Using exit codes in commands - AWS Systems Manager
Using Run Command, a capability of AWS Systems Manager, you can specify exit codes to determine how commands are handled. By default, the...
Read more >Release v1.16.24 (2019-01-23) - Google Git
This property allows the application to execute a command in order to retrieve AWS credentials for AWS service API request. In order to...
Read more >Boto3 Waiters: What are they and Use Examples - 2nd Watch
Let's walk through the anatomy of a boto3 waiter. The waiter is actually instantiated in botocore and then abstracted to boto3.
Read more >SLES12-SP3-EC2-HVM.patches.txt - SUSE
New Overlayfs Storage Driver - `docker info` now returns an `ID` and `Name` ... Implement new --force-new command line option for registration code...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi all,
Thanks again for the request. We are now submitting requests for paginators and waiters upstream so that all AWS SDKs benefit from a consistent implementation. I will pass on the request for this waiter state to the service team. We will also update the guidance in the contributing guide to better reflect this policy. I’ve added an issue to track this here:
aws/aws-sdk#86
Thanks again for bringing it to our attention!
Facing the same issue when calling the waiter right after invoking the command:
botocore.exceptions.WaiterError: Waiter CommandExecuted failed: An error occurred (InvocationDoesNotExist):
adding sleep one sec solving the issue