Issue connecting to MongoDB Atlas

Hi everyone, I’m facing the issue of connecting to Atlas. It’s not frequently but it’s happening a few times in the day.
This is an exception message:

Exception: One or more errors occurred. (A timeout occurred after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : “1”, ConnectionMode : “ReplicaSet”, Type : “ReplicaSet”, State : “Disconnected”, Servers : [{ ServerId: “{ ClusterId : 1, EndPoint : “Unspecified/production-shard-00-00.7h6j4.mongodb.net:27017” }”, EndPoint: “Unspecified/production-shard-00-00.7h6j4.mongodb.net:27017”, ReasonChanged: “ServerInitialDescription”, State: “Disconnected”, ServerVersion: , TopologyVersion: , Type: “Unknown”, LastHeartbeatTimestamp: null, LastUpdateTimestamp: “2021-06-02T14:47:58.7124234Z” }, { ServerId: “{ ClusterId : 1, EndPoint : “Unspecified/production-shard-00-01.7h6j4.mongodb.net:27017” }”, EndPoint: “Unspecified/production-shard-00-01.7h6j4.mongodb.net:27017”, ReasonChanged: “ServerInitialDescription”, State: “Disconnected”, ServerVersion: , TopologyVersion: , Type: “Unknown”, LastHeartbeatTimestamp: null, LastUpdateTimestamp: “2021-06-02T14:47:58.7062388Z” }, { ServerId: “{ ClusterId : 1, EndPoint : “Unspecified/production-shard-00-02.7h6j4.mongodb.net:27017” }”, EndPoint: “Unspecified/production-shard-00-02.7h6j4.mongodb.net:27017”, ReasonChanged: “ServerInitialDescription”, State: “Disconnected”, ServerVersion: , TopologyVersion: , Type: “Unknown”, LastHeartbeatTimestamp: null, LastUpdateTimestamp: “2021-06-02T14:47:58.7119543Z” }] }.)

I did some research and the most of recommendation is to upgrade the MongoDB driver version to the latest because the issue happened on v2.11.0.
I tried to upgrade the MongoDB driver version to 2.12.3 and MongoDB atlas to 4.4.6 but it’s still happening.
Please give me some advice to fix it.
Thanks in advance

I am not too sure but you might have stump on an Atlas free tier limits.

See https://docs.atlas.mongodb.com/reference/free-shared-limitations/

If your cluster is not a free tier, then you might want to contact customer support.

I’m using M30. I’ve tried to contact them but they said that I should pay 49$ to contact developer support :cold_face: So I put the question here first.

Unstable VPN or internet provider? May be?

Yes, I’m using VPC for peering AWS server and DB. Could you share how I can test the network?

I saw the issue:

“id”:5512201, “ctx”:“OCSP Fetch and Staple”,“msg”:“Server was unable to staple OCSP Response”,“attr”:{“reason”:{“code”:141,“codeName”:“SSLHandshakeFailed”,“errmsg”:“SSL peer certificate revocation status checking failed: Could not verify X509 certificate store for OCSP Stapling. error:00000000:lib(0):func(0):reason(0)”}}}

has anyone experience on this?

This is the exception that I am facing sometimes during load testing. It is interesting that exception do not happen if RampUp period is 60sec, but happens when rampUp period is 0 sec.

A timeout occurred after 30000ms selecting a server using CompositeServerSelector
{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }.
Client view of cluster state is
{
	ClusterId : "1",
	ConnectionMode : "ReplicaSet",
	Type : "ReplicaSet",
	State : "Disconnected",
	Servers : [
		{
			ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/ worker-1:27017" }",
			EndPoint: "Unspecified/ worker-1:27017",
			ReasonChanged: "ServerInitialDescription",
			State: "Disconnected",
			ServerVersion: ,
			TopologyVersion: ,
			Type: "Unknown",
			LastHeartbeatTimestamp: null,
			LastUpdateTimestamp: "2021-09-13T08:34:26.0630421Z"
		},
		{
			ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/ worker-2:27017" }",
			EndPoint: "Unspecified/ worker-2:27017",
			ReasonChanged: "ServerInitialDescription",
			State: "Disconnected",
			ServerVersion: ,
			TopologyVersion: ,
			Type: "Unknown",
			LastHeartbeatTimestamp: null,
			LastUpdateTimestamp: "2021-09-13T08:34:26.0633337Z"
		},
		{
			ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/master:27017" }",
			EndPoint: "Unspecified/master:27017",
			ReasonChanged: "ServerInitialDescription",
			State: "Disconnected",
			ServerVersion: ,
			TopologyVersion: ,
			Type: "Unknown",
			LastHeartbeatTimestamp: null,
			LastUpdateTimestamp: "2021-09-13T08:34:26.0593152Z"
		}
	]
}.

Does anyone have slightest idea what could be the cause?
.NET driver is version 2.13.1, mongo is at 4.4.8

This is a known issue with MongoDB versions 4.4 and 5.0 on Atlas. It is fixed with SERVER-57716 which will be released with versions 4.4.9 and 5.0.3.

The effect of this issue is that clients cannot take advantage of OCSP stapling and may contact the OCSP responder themselves.