How can I troubleshoot connectivity failures between AWS DMS and a MongoDB source endpoint?

Last updated: 2019-09-26

The connectivity between my AWS Database Migration Service (AWS DMS) replication instance and my MongoDB source endpoint failed. How can I troubleshoot "Test Endpoint failed" errors when using MongoDB as the source endpoint?

Resolution

A MongoDB source endpoint can fail to connect for several reasons. See the following common errors and their resolutions.

Connection timeout calling errors

If an AWS DMS replication instance can't connect to the MongoDB database that is specified, you receive the following error:

Test Endpoint failed: Application-Status: 1020912, Application-Message: Failed to create new client connection Failed to connect to database., Application-Detailed-Message: Error verifying connection: 'No suitable servers found (`serverSelectionTryOnce` set): [connection timeout calling ismaster on 'mongodbtest.us-west-2.compute.amazonaws.com:27017']' Failed to connect to database.

This error occurs when connectivity can't be established between the AWS DMS replication instance to the MongoDB database. Most often, this is caused by configuration issues in the security groups, network access control lists (network ACLs), or on-premises firewalls and IP address tables. To resolve this error, confirm that your network is configured to meet the connectivity requirements for AWS DMS replication instances.

Connection refused calling errors

When the connection request from the AWS DMS replication instance is refused by the MongoDB instance, you receive the following error:

Test Endpoint failed: Application-Status: 1020912, Application-Message: Failed to create new client connection Failed to connect to database., Application-Detailed-Message: Error verifying connection: 'No suitable servers found (`serverSelectionTryOnce` set): [connection refused calling ismaster on 'mongodbtest.us-west-2.compute.amazonaws.com:27017']' Failed to connect to database.

This error occurs when the the bindIp settings on the MongoDB database don't allow access to connections from replication instances. To resolve this error, modify the bindIp configuration on the MongoDB instance to allow connections from replication instances. For more information, see the MongoDB documentation for IP Binding.

Authentication failed errors

When the credentials provided aren't correct or use a special character, you receive the following error:

Test Endpoint failed: Application-Status: 1020912, Application-Message: Failed to create new client connection Failed to connect to database., Application-Detailed-Message: Error verifying connection: 'Authentication failed.' Failed to connect to database.

This error occurs when the user name or password provided in the endpoint are incorrect, the authentication source database provided the for the user name field is incorrect, or you used a special character in your password that MongoDB doesn't accept. For more information, see Creating Source and Target Endpoints.

To resolve this error, confirm that you have the correct authentication credentials by connecting to the MongoDB database using the user name and password provided in the endpoint.

Libmongoc version errors

When you use a version of MongoDB that isn't supported for AWS DMS replication, you receive the following error:

Test Endpoint failed: Application-Status: 1020912, Application-Message: Failed to create new client connection Failed to connect to database., Application-Detailed-Message: Error verifying connection: 'Server at ec2-35-166-73-109.us-west-2.compute.amazonaws.com:27017 reports wire version 2, but this version of libmongoc requires at least 3 (MongoDB 3.0)' Failed to connect to database.

To resolve this error, upgrade the source MongoDB database to a version of MongoDB that is supported by AWS DMS.