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.

DatabaseMigrationService.Waiter.ReplicationTaskStopped doesn't work for recently started jobs

See original GitHub issue

Use case

I have a job that kicks off a DMs replication task on a periodic basis.

Expected behaviour

DatabaseMigrationService.Waiter.ReplicationTaskStopped waits for the replication task to reach a stopped or error state.

Actual behaviour

Errors out immediately with:

Traceback (most recent call last):
  File "lambda-dms-kickoff.py", line 41, in <module>
    lambda_handler({},{})
  File "lambda-dms-kickoff.py", line 33, in lambda_handler
    'Values': [DMS_TASK_ARN]
  File "/Users/Jared/git-repos/aws-lambda-attachment-extractor/.venv/lib/python3.6/site-packages/botocore/waiter.py", line 53, in wait
    Waiter.wait(self, **kwargs)
  File "/Users/Jared/git-repos/aws-lambda-attachment-extractor/.venv/lib/python3.6/site-packages/botocore/waiter.py", line 323, in wait
    last_response=response,
botocore.exceptions.WaiterError: Waiter ReplicationTaskStopped failed: Waiter encountered a terminal failure state

This is also the case with the AWS CLI:

aws --region us-east-1 dms wait replication-task-stopped --filters "Name=replication-task-arn,Values=$replication_task_arn"

Waiter ReplicationTaskStopped failed: Waiter encountered a terminal failure state

Although if I check the status manually, I can see it’s in a non-terminal and non-failure state:

aws --region us-east-1 dms describe-replication-tasks --filters "Name=replication-task-arn,Values=$replication_task_arn" --query "ReplicationTasks[0].Status"

"starting"

Code

    start_resp = dms.start_replication_task(
        ReplicationTaskArn=DMS_TASK_ARN,
        StartReplicationTaskType='reload-target'
    )

    time.sleep(3)

    waiter = dms.get_waiter('replication_task_stopped')
    waiter.wait(Filters=[
        {
            'Name': 'replication-task-arn',
            'Values': [DMS_TASK_ARN]
        },
    ])

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
Visyacommented, May 9, 2021

This is still an issue which makes waiters for ‘running’ and ‘stopped’ states almost unusable. Is there any plans to fix this?

4reactions
milesgrangercommented, Sep 30, 2020

@swetashre Can we re-open this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting migration tasks in AWS Database Migration ...
Troubleshoot issues when migrating data using AWS Database Migration Service (AWS DMS).
Read more >
DatabaseMigrationService — Boto3 Docs 1.26.33 ... - AWS
A low-level client representing AWS Database Migration Service ... open-source databases such as Oracle, PostgreSQL, Microsoft SQL Server, Amazon Redshift, ...
Read more >
aws dms - Fig.io
AWS Database Migration Service AWS Database Migration Service (AWS DMS) can migrate your data to and from the most widely used commercial and...
Read more >
Create a migration job | Database Migration Service
Database Migration Service uses migration jobs to migrate data from your ... how the newly created Cloud SQL instance will connect to the...
Read more >
Best Practices for Using AWS DMS for SQL Server Replication
Basic concepts for getting started with Amazon Database Migration Service · AWS DMS Replication Instances · AWS DMS Endpoints · Amazon DMS Tasks....
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