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

mongodb+srv connection string no longer works with version 2.9.0

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker - P1
    • Resolution: Fixed
    • 2.9.0
    • 2.9.1
    • Connectivity
    • None

    Description

      Using a connection string with the format

      mongodb+srv://<username>:<password>@fireflydev-horrk.gcp.mongodb.net?retryWrites=true

      I can successfully connect to sharded cluster using the C# client version 2.8.1

      Unfortunatelly, when attempting to connect to the same cluster with the C# client version 2.9.0, using the same connection string and the same code, I get a timeout exception, hence not being able to connect:

      A timeout occured 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 : [] }.

      This is the stack trace on this exception:

      at MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException(IServerSelector selector, ClusterDescription description) in Cluster.cs:line 366
       at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedHelper.HandleCompletedTask(Task completedTask) in Cluster.cs:line 549
       at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChanged(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken) in Cluster.cs:line 346
       at MongoDB.Driver.Core.Clusters.Cluster.SelectServer(IServerSelector selector, CancellationToken cancellationToken) in Cluster.cs:line 234
       at MongoDB.Driver.MongoClient.AreSessionsSupportedAfterServerSelection(CancellationToken cancellationToken) in MongoClient.cs:line 421
       at MongoDB.Driver.MongoClient.AreSessionsSupported(CancellationToken cancellationToken) in MongoClient.cs:line 395
       at MongoDB.Driver.MongoClient.UsingImplicitSession(Action`1 func, CancellationToken cancellationToken) in MongoClient.cs:line 557
       at MongoDB.Driver.MongoClient.DropDatabase(String name, CancellationToken cancellationToken) in MongoClient.cs:line 125
       at ConnectionString2_9.Program.Main() in C:\Users\jose.mira\source\repos\DevConnectionTests\ConnectionString2_9\Program.cs:line 21

      I am missing something on the connection string?
       

      Attachments

        Issue Links

          Activity

            People

              dmitry.lukyanov@mongodb.com Dmitry Lukyanov
              jose.mira@paymentsense.com José Mira
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: