Hello I using new libabry Couchbase-Net-Client 3.0.0 in our project based on dotnet core 3.0.
When Service connect to couchbase 6.5.1 library fails with next stacktrace
at Couchbase.Core.Configuration.Server.BucketConfigExtensions.ReplacePlaceholderWithBootstrapHost(BucketConfig config, String host)
at Couchbase.Core.ClusterNode.d__107.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at Couchbase.Core.ClusterContext.d__49.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at Couchbase.Cluster.d__42.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at Couchbase.Cluster.d__22.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Shared.CouchbaseClient.CouchbaseClusters.d__6.MoveNext() in C:\Marg\4O_Backend\src\Lib.Shared\CouchbaseClient\CouchbaseClusters.cs:line 120
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Shared.StorageClient.StorageClient.d__2.MoveNext() in C:\Marg\4O_Backend\src\Lib.Shared\StorageClient\StorageClient.cs:line 18
I was testing on windows, and my couchbase server is standalone with services (data, query, index)
I suspect its a bug; can you enable logging and post a snippet of the logs as you bootstrap and run into this issue? I created an NCBC-2487 to track as I cannot reproduce the issue locally. Also, add your bootstrapping code if possible.
If i want to use my own serializer (NamingStrategy - because we have document save with this naming and then query language doesnt work). So i use own serialzer. Do I miss something?
var jsonSettings = new JsonSerializerSettings()
{
NullValueHandling = NullValueHandling.Ignore,
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate,
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
ContractResolver = new DefaultContractResolver
{
NamingStrategy = new DefaultNamingStrategy()
}
};
clusterOptions.Serializer = new DefaultSerializer(jsonSettings, jsonSettings);
I think maybe this is a separate issue? If so, can you create a new forum post and include the error message returned? If you can enable logging, that will help more if they are provided.
If a change the default serizalizer, the problem is on BootstrapAsync (file CouchbaseBucket.cs line 270)
BucketConfig = await node.GetClusterMap().ConfigureAwait(false); I got null BucketConfig I supposed because serialization changed - so bootstrap failed with null exception because BucketConfig == null.
The question is - on version 2.x you can registered your own serializer is this changed in 3.x.
I also saw that on (Upsert)Options we have posibility to set transcoder, but i really want set this globally on cluster options.
Thanks for the detals. I’ll need to look deeper into this; the intention was to allow the cluster serializer be set on ClusterOptions, as you did. Additionally, as you mentioned the serializer (via a custom ITypeTranscoder) can be set on a per-operation basis.
The reason is to be able to customize it for your documents and querying ability, however, internally we serialize system JSON as well. In that case the JSON format is specified by the server and we to follow whatever formatting its using. I suspect this isn’t working as intended in the SDK and updated the ticket (NCBC-2487) to reflect this.