[CSHARP-2698] Cannot connect using SRV in 2.9.0 C# Driver Created: 20/Aug/19  Updated: 22/Aug/19  Resolved: 22/Aug/19

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: Alex Bevilacqua Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates CSHARP-2697 mongodb+srv connection string no long... Closed
Case:

 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


 Comments   
Comment by Jeffrey Yemin [ 20/Aug/19 ]

Closing as a duplicate of CSHARP-2697

Generated at Wed Feb 07 21:43:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.