Skip to content

Urgent: DocumentDB Connection Stopped unexpectedly

0

Hi, Today all of a sudden our connection to DocumentDB stopped from Elastic beanstalk. This is a really urgent situation at the moment for us. Is there anyone who would have any idea why this happened? Here is the error we are getting MongoDBConnectionError: mongodb://USER:PASS@stardust-prod-documentdb.cluster-cnilhxgh3v4y.us-west-2.docdb.amazonaws.com:27017/stardust_dev MongoServerError: Unsupported mechanism [ -301 ] Best,

asked 2 years ago802 views

2 Answers
0

I understand this is an urgent situation for you. There could be several reasons why your connection to Amazon DocumentDB from Elastic Beanstalk stopped unexpectedly. Here are some potential causes and things to check:

  1. Network connectivity: Ensure that your Elastic Beanstalk environment is in the same VPC and has the correct security group settings to allow connections to your DocumentDB cluster.

  2. Failover event: DocumentDB may have undergone an automatic failover, which typically takes about 30 seconds. In this case, your application should be configured to automatically retry database connections.

  3. Cluster stopped: Check if your DocumentDB cluster was accidentally stopped. If so, you'll need to restart it. Note that Amazon DocumentDB automatically starts stopped clusters after 7 days to prevent them from falling behind on maintenance.

  4. Connection pool issues: Verify that your application's connection pool settings, particularly the 'maxPoolSize', are configured correctly for your workload.

  5. Region mismatch: Confirm that your Elastic Beanstalk environment and DocumentDB cluster are in the same AWS region.

  6. Maintenance or updates: Check if there was any scheduled maintenance or updates that might have caused a temporary disruption.

To resolve the issue:

  1. Verify the status of your DocumentDB cluster in the AWS Console or using AWS CLI.
  2. If the cluster is stopped, restart it using the AWS Management Console or the AWS CLI's 'start-cluster' operation.
  3. Review your application logs for any specific error messages.
  4. Ensure your application is set up to handle connection losses by implementing retry logic.
  5. Check the security group settings to confirm that inbound connections are allowed from your Elastic Beanstalk environment to the DocumentDB cluster.

If the issue persists after checking these points, you may need to contact AWS Support for further assistance, as they can provide more detailed diagnostics based on your specific setup.
Sources
Connection issues - Amazon DocumentDB
Amazon DocumentDB Failover - Amazon DocumentDB
Stopping and starting an Amazon DocumentDB elastic cluster - Amazon DocumentDB
StartDBCluster - Amazon DocumentDB

answered 2 years ago

0

We identified the root cause and resolved the issue. The outage was due to a recent change in the connection requirements for DocumentDB. Previously, we connected directly, but now it appears we need to add the 'authSource' parameter to establish the connection. This requirement seems to have come into effect today, as it wasn’t needed before.

It would be helpful if any changes related to DocumentDB authentication could be communicated to all customers.

Best

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.