Driver can't connect to a member of an un-initiated replica set

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.12.1, 3.0.0
    • Affects Version/s: 2.12.0
    • Component/s: Cluster Management
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Start mongod like:

      mongod --replSet test
      

      and try to send a command:

              MongoClient mongo = new MongoClient(new MongoClientURI("mongodb://localhost:27001"));
              CommandResult result = mongo.getDB("admin").command("ping");
      

      It fails with this exception:

      Exception in thread "main" com.mongodb.MongoServerSelectionException: Unable to connect to any servers
      

      The root cause is that ClusterDescription.getAny() only returns server descriptions where isPrimary || isSecondary is true.

            Assignee:
            Jeffrey Yemin
            Reporter:
            Jeffrey Yemin
            None
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: