Couchbase net core on Linux

Hi,

I have a .net app that uses CouchbaseNetClient, and I am trying to get it running under linux in Asp.net core 1.0.0. I am having this exception :

{
  "message": "Could not acquire a server.",
  "data": {},
  "innerException": null,
  "stackTrace": "   at Couchbase.Core.Buckets.CouchbaseRequestExecuter.<>c__DisplayClass20_0`1.<<SendWithRetryAsync>b__0>d.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at Couchbase.Core.Buckets.CouchbaseRequestExecuter.<RetryQueryEveryAsync>d__7`1.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n   at Couchbase.Core.Buckets.CouchbaseRequestExecuter.<SendWithRetryAsync>d__20`1.MoveNext()",
  "helpLink": null,
  "source": "Couchbase.NetClient",
  "hResult": -2146233083
}

@mbenaissa

Thanks for moving this info over to the forums where we can track it.

Based on the error, I suspect that the error is actually happening earlier during the server connection process. Then the attempt to read/write is failing because none of the connections are functioning.

To trace this, we’re probably going to need to get logging working. Unfortunately, since we’re still in development we haven’t yet tried to get logging working in a .Net Core environment, so it might take some experimentation. Any assistance you can provide is greatly appreciated.

We are using the Common.Logging framework, which is a logging abstraction layer, just like we do for the .Net Desktop SDK. Unfortunately, the core version of this logging framework doesn’t support config files, and must be configured in code. Also, we normally log via NLog or log4net, which I don’t think are .Net Core compatible.

Do you have a logging framework setup already in your application? Any does it have an adapter for Common.Logging?

Brant

@btburnett3, @mbenaissa -

Assuming this is not during a rebalance/failover/swap scenario, I suspect that when the Server objects are being created in CouchbaseConfigContext.LoadConfig(…) (or MemcachedConfigContext) there is an error and an exception is thrown, thus they never populate the list of servers that the client is using to select a node to execute the command on.

Will either need logs or to pull the source and debug it manually to determine what exactly is causing the servers list to not be populated.

-Jeff

@mbenaissa

Would you mind giving the latest master branch a try? We’ve made some improvements, and my tests show it working on .Net Core on Linux now, at least for basic functionality.

You might also enable logging, which now works with in .Net Core. Unfortunately, the supported loggers are still limited, but here’s an example that will log to the Debug window in Visual Studio:

Thanks,
Brant

Hi @btburnett3 ,

Great it works now :wink:

Thanks for your help and good luck for the rest :slight_smile:

2 Likes