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:
I think this error probably existed before, but was being disguised until new error handling code was added in 3.4.7:
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