Error message | Cause and solution |
network error while attempting to run command 'isMaster' on host 'dds-xxxx.mongodb.rds.aliyuncs.com:3717' :exception: connect failed
| |
Timed out after 3000ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. exception=(com.mongodb.MongoSocketReadException: Prematurely reached end of stream)
Socket recv() errno:54 Connection reset by peer x.x.x.x:27017
| The instance may have reached its maximum connection limit and cannot establish new connections. Solution: Check if the instance connection limit has been reached. For more information, see How do I query the number of connections?. Optimize connection usage. For more information, see What do I do if the number of connections to my instance reaches the upper limit?.
|
MongoDB.Driver.MongoWaitQueueFullException: The wait queue for acquiring a connection to server xxx is full.
| The wait queue of the MongoDB driver is full. This can happen if the connection pool size is too small or if there are high-concurrency requests, resulting in no available connections. Solution: First, check the connection pool configuration in your application, such as setting an appropriate pool size. For more information, see How do I limit the number of client connections?. If the issue persists after you adjust the program's configuration, check whether the MongoDB instance has exhausted its connection limit. For more information, see: How do I query the number of connections? What do I do if the number of connections to my instance reaches the upper limit?
|
(TooManyLogicalSessions) Unable to add session into the cache because the number of active sessions is too high.
| Excessive concurrent connections may exhaust available sessions. Solution: Troubleshoot connection failures caused by exhausted connections. How do I query the number of connections? What do I do if the number of connections to my instance reaches the upper limit?
If the number of connections is normal, check if other performance metrics of the instance are sufficient for your business requirements. Use the node monitoring feature to check the usage of common resources, such as CPU and memory usage. This helps you determine whether the instance type meets your business requirements. If the instance type is too small for the high workload, change the instance configuration during off-peak hours.
|
| Check if the instance endpoint is correct. For more information about endpoints, see: |
Failed to connect to 10.*.*.8:3717 after 5000 milliseconds, giving up.Error: couldn't connect to server 10.*.*.8:3717 (10.*.*.8), connection attempt failed
pymongo.errors.ServerSelectionTimeoutError: dds-xxxx.mongodb.rds.aliyuncs.com:3717: [Errno 113] No route to host,dds-xxxx.mongodb.rds.aliyuncs.com:3717
InvalidInstanceId.NotFound: The instance not in current vpc.
| This error occurs when an ECS instance fails to connect to an ApsaraDB for MongoDB instance over a private network. Solution: Check the whitelist settings. Ensure that the private IP address of the ECS instance is added to a whitelist of the ApsaraDB for MongoDB instance. Ensure that the ECS instance and the MongoDB instance can communicate with each other. If the ECS instance and the MongoDB instance are in the same VPC, they can connect directly over the private network. To connect instances across different VPCs, perform one of the following actions.
|
org.springframework.data.mongodb.UncategorizedMongoDbException: Timeout while receiving message; nested exception is com.mongodb.MongoSocketReadTimeoutException: Timeout while receiving message
| |
"errmsg": "not master", "code": 10107, "codeName": "NotMaster"
"errmsg": "not master", "code": 10107, "codeName": "NotWritablePrimary"
Time out after 30000ms while waiting for a server that matches writableServerSelector.
Command failed with error 10107 (NotWritablePrimary): 'not primary' on server xxx.
Explain's child command cannot run on this node. Are you explaining a write command on a secondary?
not master and slaveOk=false.
MongoNotPrimaryException: Command failed with error 10107 (NotMaster): 'not master' on server xxx.
reason: TopologyDescription { type: 'ReplicaSetNoPrimary',...}
| This error occurs when a write operation is attempted on a node that is not the primary node. Cause: Write operations can be performed only on the primary node. If your service previously connected using the endpoint of the primary node, the connected node becomes a secondary node after a primary-secondary switchover. As a result, write operations fail. Solution: In a production environment, connect your application to the database using a ConnectionStringURI endpoint. If a node fails, a primary-secondary switchover will not affect the read and write operations of your application. For more information about endpoints, see: Manually switch node roles. Switch the node that corresponds to the single-node endpoint used by your service to the primary node.
Design a reconnection mechanism and exception handling for your application. This ensures that your application can automatically reconnect after a transient disconnection and remain stable. |
[Unauthorized] cloud instance error, disk locked, plz check and upgrade your disk quota,
| The instance is locked because the disk space is exhausted. Solution: Resolve instance locking or write failures caused by exhausted disk space. |
(AuthenticationFailed) Authentication failed.
| |
| The password of the database account contains special characters such as !@#$%^&*()_+=. Solution: How do I resolve connection failures caused by special characters in the account or password of a connection string?. |
error getting cluster ID: (CommandNotFound) replSetGetConfig is forbidden by cloud provider for security reason
| ApsaraDB for MongoDB does not support the replSetGetConfig command. For more information, see Supported and unsupported commands in ApsaraDB for MongoDB |