question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WaiterError: Run Command Waiter not able to access command ID right after send_command is invoked.

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
stobrien89commented, May 28, 2021

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!

1reaction
ayalganem55commented, May 2, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found