.NET SDK / Couchbase 5.1 issue

We recently performed an upgrade from Couchbase Server Enterprise 4.6.3 to 5.1.0. We’re using the .NET SDK version 2.5.10. After the upgrade, we are receiving the following exception upon every Couchbase request:

Handling disconnect for connection 5c2c6a19-8b87-4c16-a447-89bd9869d0dc: “System.ObjectDisposedException: Cannot access a disposed object.
Object name: ‘System.Net.Sockets.Socket’.
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, SocketError& errorCode)
at Couchbase.IO.MultiplexingConnection.Send(Byte[] request)”

It’s a warning only but our logs are getting spammed with these exceptions about every 10 seconds. Also, on our local developer machines we did a clean install of 5.1.0 and we do not get the same exceptions as we are in our upper environments.

We register ICluster and IBucket as singletons in our .NET Core 2.0.1 application.

Any insight into what we should do to fix this issue would be greatly appreciated.

Hi @paul.crossan,

Are you able to see where in the code this exception is being thrown, via debug mode perhaps? It seems like a cluster or a bucket has been disposed/closed (maybe this was a race condition that the upgrade exposed).

Also, this is probably not related, but I don’t believe you need to register IBucket as singletons. I’m not sure it hurts anything, but I also don’t think there are any benefits to doing it (in general).

Thanks for the reply, @matthew.groves. Turns out we had an old cluster of Enterprise 4.6.3 running which was causing the flooding of exceptions!