Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
-
2
-
SDK20
Description
I've tried to build and run the following snippet with the credentials replaced:
using System;
using System.Threading.Tasks;
using Couchbase;
await new CloudExample().Main();
class CloudExample
{
public async Task Main()
{
var options = new ClusterOptions
;
options.KvIgnoreRemoteCertificateNameMismatch = true;
options.HttpIgnoreRemoteCertificateMismatch = true;
options.ApplyProfile("wan-development");
var cluster = await Cluster.ConnectAsync(
// Update these credentials for your Capella instance
"<connection-string>",
options
);
// get a bucket reference
var bucket = await cluster.BucketAsync("<bucket>");
// get a user-defined collection reference
var scope = await bucket.ScopeAsync("samples");
var collection = await scope.CollectionAsync("airline");
// Call the QueryAsync() function on the scope object and store the result.
var inventoryScope = bucket.Scope("samples");
var queryResult = await inventoryScope.QueryAsync<dynamic>("SELECT * FROM airline WHERE id = 10");
// Iterate over the rows to access result data and print to the terminal.
await foreach (var row in queryResult)
}
}
It throws the Following error:
Unhandled exception. Couchbase.ServiceNotAvailableException: Service n1ql is either not configured or cannot be reached. Check logs for details.
at Couchbase.Core.ClusterContext.GetRandomNodeForService(ServiceType service, String bucketName)
at Couchbase.Core.ServiceUriProvider.GetRandomQueryUri()
at Couchbase.Query.QueryClient.ExecuteQuery[T](QueryOptions options, ITypeSerializer serializer, IRequestSpan span)
at Couchbase.Query.QueryClient.QueryAsync[T](String statement, QueryOptions options)
at Couchbase.Cluster.<>c_DisplayClass35_0`1.<<QueryAsync>g_Func|0>d.MoveNext()
— End of stack trace from previous location —
at Couchbase.Core.Retry.RetryOrchestrator.RetryAsync[T](Func`1 send, IRequest request)
at Couchbase.Cluster.QueryAsync[T](String statement, QueryOptions options)
at CloudExample.Main() in /Users/dazad/RiderProjects/Program/Program/Program.cs:line 209
at Program.<Main>$(String[] args) in /Users/dazad/RiderProjects/Program/Program/Program.cs:line 176
at Program.<Main>(String[] args)