0

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/mdr-non-prod-tst-shard-00-00-4rmha.azure.mongodb.net:27017" }",
        EndPoint: "Unspecified/mdr-non-prod-tst-shard-00-00-4rmha.azure.mongodb.net:27017", 
        State: "Disconnected", Type: "Unknown", LastUpdateTimestamp: "2020-03-30T14:09:08.2853263Z" },
        { 
            ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/mdr-non-prod-tst-shard-00-01-4rmha.azure.mongodb.net:27017" }", 
            EndPoint: "Unspecified/mdr-non-prod-tst-shard-00-01-4rmha.azure.mongodb.net:27017", 
            State: "Disconnected", 
            Type: "Unknown", 
            LastUpdateTimestamp: "2020-03-30T14:09:08.2963257Z" 
        }, 
        { 
            ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/mdr-n
Oguz Ozgul
  • 6,809
  • 1
  • 14
  • 26
  • Please include more info about what you are trying to achieve, and previous analysis you have made. Also please try to format in a more readable way. – Andre Soares Mar 30 '20 at 20:54
  • @user13157396 Not get your response for several days, would you please share your latest information about this issue? If you have any concern, feel free to share it here. – Hugh Lin Apr 02 '20 at 08:42

1 Answers1

0

Have you tried adding ?connect=replicaSet after your connection string :

new MongoClient("mongodb://username:password@ds011111.mongolab.com:11111/db-name?connect=replicaSet")

Basically the default is to connect to a replica set member. But MongoLab's Single-Node settings are actually a single node replica set and this causes us to not trust it. Appending ?connect=replicaSet to your connection string will force the driver to move into replica set mode and all will work.

You can refer to this case with similar issue for details.

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25