Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2698

Cannot connect using SRV in 2.9.0 C# Driver

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical - P2
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      Using the following unit tests against 2.9.0 and 2.8.1 we can reproduce this issue.

      [TestMethod]
      public void TestConnectionCopyPastedFromAtlas36Style()
      {
          string conn = "mongodb+srv://xxx:xxx@m10-dev-dgtt4.mongodb.net/test?retryWrites=true&w=majority&serverSelectionTimeoutMS=5000";
          
          var client = new MongoClient(conn);
          var database = client.GetDatabase("test");
          database.RunCommandAsync((Command<BsonDocument>)"{ping:1}").Wait();
      }
       
      [TestMethod]
      public void TestConnectionCopyPastedFromAtlas34Style()
      {    
          string conn = "mongodb://xxx:xxx@m10-dev-shard-00-00-dgtt4.mongodb.net:27017,m10-dev-shard-00-01-dgtt4.mongodb.net:27017,m10-dev-shard-00-02-dgtt4.mongodb.net:27017/test?ssl=true&replicaSet=m10-dev-shard-0&authSource=admin&retryWrites=true&w=majority";
          
          var client = new MongoClient(conn);
          var database = client.GetDatabase("test");
          database.RunCommandAsync((Command<BsonDocument>)"{ping:1}").Wait();
      }
      

      • Using 2.9.0 the test using the SRV record will fail
      • Using 2.8.1 both will pass

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              alex.bevilacqua@mongodb.com Alex Bevilacqua
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: