-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 2.4.4
-
Component/s: Connectivity
-
None
-
Environment:OS: Windows 2012 R2
.NET Version: dotnetcore 1.1
Project Type: Web API
SSL Certificate: Self Signed
Replicaset: Yes, with three members
1. Created Data access library (using repository pattern) to access mongo collection.
2. Connecting to DB using new MongoClient(connectionString)
3. Using MongoClient.GetDatabase to get DB.
4. Using IMongoDatabase.GetCollection to fetch data from a collection.
Issue:
In the test environment, started getting exception:
HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
To solve above, added "sslverifycertificate=false" to the connection string. This solved the certification validation exception, but another intermittent issue cropped up, below is the information:
Connection id ""XXXXXX"": An unhandled exception was thrown by the application.
System.TimeoutException: A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = ReadPreferenceServerSelector{ ReadPreference =
}, 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/_MemberServer1_:27017" }", EndPoint: "Unspecified/MemberServer1:27017", State: "Disconnected", Type: "Unknown" }, { ServerId: "
{ ClusterId : 1, EndPoint : "Unspecified/_MemberServer2_:27017" }", EndPoint: "Unspecified/MemberServer2:27017", State: "Disconnected", Type: "Unknown" }, { ServerId: "
{ ClusterId : 1, EndPoint : "Unspecified/_MemberServer3_:27017" }", EndPoint: "Unspecified/MemberServer3:27017", State: "Disconnected", Type: "Unknown" }] }.
at MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException(IServerSelector selector, ClusterDescription description)