Diagnose and fix connection failures for ApsaraDB for MongoDB instances. Start with Common errors for quick fixes, or follow Troubleshooting steps to systematically identify the root cause.
Troubleshooting steps
Step 1: Check network connectivity
Troubleshooting method
Test connectivity to the ApsaraDB for MongoDB instance with the following commands.
-
Run the
ping <domain>command. For example, runping dds-xxxx.mongodb.rds.aliyuncs.com.ping dds-xxx.mongodb.rds.aliyuncs.com PING dds-xxx.mongodb.rds.aliyuncs.com (xxx): 56 data bytes 64 bytes from xxx: icmp_seq=0 ttl=90 time=7.698 ms 64 bytes from xxx: icmp_seq=1 ttl=90 time=7.085 ms 64 bytes from xxx: icmp_seq=2 ttl=90 time=11.006 ms 64 bytes from xxx: icmp_seq=3 ttl=90 time=12.154 ms 64 bytes from xxx: icmp_seq=4 ttl=90 time=9.149 msThis output confirms the client can reach the ApsaraDB for MongoDB instance.
-
Run the
telnet <domain> <port>command. For example, runtelnet dds-xxxx.mongodb.rds.aliyuncs.com 3717.root@mongotest:~# telnet xxx.mongodb.rds.aliyuncs.com 3717 Trying xxx... Connected to xxx.mongodb.rds.aliyuncs.com. Escape character is '^]'.This output confirms DNS resolution and port 3717 accessibility.
Checklist
If the network test fails, check the following items.
Step 2: Authorization and authentication
Step 3: Other checks
Common errors
|
Error message |
Cause and solution |
|
|
|
|
The instance may have reached its connection limit. Solution:
|
|
|
The MongoDB driver wait queue is full, likely due to an undersized connection pool or high concurrency. Solution:
|
|
|
Excessive concurrent connections can exhaust available sessions. Solution:
|
|
Verify that the instance endpoint is correct: |
|
An ECS instance fails to connect to an ApsaraDB for MongoDB instance over a private network. Solution:
|
|
|
|
|
The node to which data is being written is not a primary node. Cause: Write operations can be performed only on the primary node. If your application was previously connected by using the endpoint of the primary node, a failover can change the connected node to a secondary node, which causes write operations to fail. Solution:
Implement a reconnection mechanism and exception handling in your application to ensure automatic recovery from transient disconnections. |
|
|
Exhausted disk space has locked the instance. Solution: Resolve instance locking or write failures caused by exhausted disk space. |
|
|
|
|
The password of the database account contains special characters, such as |
|
|
ApsaraDB for MongoDB does not support |