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

Client crashes when trying to initializing the mongoclient when setting clusterconfigurator

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.23.0
    • Component/s: API, Configuration, Logging
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Summary

      updated to the latest version 2.23.0 from 2.22.0. An exception is thrown during the call to

      // code placeholder
      _dbSettings1.ClusterConfigurator = builder =>
                  {
                      builder.Subscribe<ConnectionPoolAddedConnectionEvent>(e =>
                     {
                         connectionAdded++;
                         //Console.WriteLine("Total Added Connections: " + connectionAdded);
                     });
                      builder.Subscribe<ConnectionPoolRemovedConnectionEvent>(e =>
                     {
                         connectionRemoved++;
                         //Console.WriteLine("Total Removed Connections: " + connectionRemoved);
                     });
                  }; 
      _mongoClient = new MongoClient(_dbSettings);
      // code placeholder
      Value cannot be null.
      Parameter name: factory
      Source: Microsoft.Extensions.Logging.Abstractions
      Thread started: <Thread Pool> #21
        at Microsoft.Extensions.Logging.LoggerFactoryExtensions.CreateLogger[T] (Microsoft.Extensions.Logging.ILoggerFactory factory) [0x00003] in <d7a3ca84869f48e0aa5c354ee22cb1ee>:0 
        at MongoDB.Driver.Core.Clusters.ClusterFactory.<ProcessClusterEnvironment>g__LogIfExternalEnvironment|9_2 (System.String host, System.String environment, System.String documentationUrl, System.String[] suffixes) [0x00022] in <9a38b6dbb2264f9885b4250438ce22a4>:0 
        at MongoDB.Driver.Core.Clusters.ClusterFactory.<ProcessClusterEnvironment>g__LogIfCosmosDB|9_0 (System.String host) [0x00000] in <9a38b6dbb2264f9885b4250438ce22a4>:0 
        at MongoDB.Driver.Core.Clusters.ClusterFactory.ProcessClusterEnvironment (MongoDB.Driver.Core.Configuration.ClusterSettings settings) [0x0002b] in <9a38b6dbb2264f9885b4250438ce22a4>:0 
        at MongoDB.Driver.Core.Clusters.ClusterFactory.CreateCluster () [0x00007] in <9a38b6dbb2264f9885b4250438ce22a4>:0 
        at MongoDB.Driver.Core.Configuration.ClusterBuilder.BuildCluster () [0x00006] in <9a38b6dbb2264f9885b4250438ce22a4>:0 
        at MongoDB.Driver.ClusterRegistry.CreateCluster (MongoDB.Driver.ClusterKey clusterKey) [0x000cf] in <6926c8350547439997c522a25b1c60d3>:0 
        at MongoDB.Driver.ClusterRegistry.GetOrCreateCluster (MongoDB.Driver.ClusterKey clusterKey) [0x00021] in <6926c8350547439997c522a25b1c60d3>:0 
        at MongoDB.Driver.MongoClient..ctor (MongoDB.Driver.MongoClientSettings settings) [0x0003e] in <6926c8350547439997c522a25b1c60d3>:0  

      Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).

      the working version is 2.22.0

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            sasan.pasha@gmail.com Sasan Pasha
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: