Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-3399

Regression in bootstrapping in 3.4.7 around NRE in PruneNodes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 3.4.8
    • 3.4.7
    • library
    • None
    • 0

    Description

      When upgrading from 3.4.6 to 3.4.7 bootstrapping began to fail, showing this exception in the logs:

      System.NullReferenceException: Object reference not set to an instance of an object. at Couchbase.Core.ClusterContext.<>c__DisplayClass70_0.<PruneNodes>b__1(IClusterNode x) at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() at Couchbase.Core.ClusterContext.PruneNodes(BucketConfig config) at Couchbase.Core.ClusterContext.ProcessClusterMapAsync(BucketBase bucket, BucketConfig config)
      

      Based on review of the stack trace, I believe this is caused by the lack of a null check on IClusterNode.Owner here:

      https://github.com/couchbase/couchbase-net-client/blob/b527bc98b681f89fae5954d7c1aad4eb01b49c35/src/Couchbase/Core/ClusterContext.cs#L834

      I think this error probably existed before, but was being disguised until new error handling code was added in 3.4.7:

      https://github.com/couchbase/couchbase-net-client/commit/7f3bf0f95142114b6453be6f4e26154fe884adbe#diff-ba5e9d3a81abb2d724c35296910c9b3a53782d6c9648fbcc3b4403cad8a60120R816

      Now it throws the exception instead of simply logging and moving on.

      In case it's a factor, the Couchbase Server details are:

      • Couchbase Server 6.6.5 Enterprise
      • Running in K8S via the Autonomous Operator
      • Two buckets used by this service, one Couchbase and one Ephemeral
      • MDS scaling with separate services per node

      Application details:

      • .NET 6 using ASP.NET Core MVC
      • Using DI extensions
      • Not using WaitUntilReadyAsync, simply requesting the bucket

      Attachments

        For Gerrit Dashboard: NCBC-3399
        # Subject Branch Project Status CR V

        Activity

          People

            jmorris Jeff Morris
            btburnett3 Brant Burnett
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty