"Service is not configured or supported by the cluster" error when trying to query a View

I’m trying to query a View with the .NET Couchbase SDK using the following code:

var bucket = ClusterHelper.GetBucket("mybucket");
var query = bucket.CreateQuery("dev_doc", "my_view").Limit(5);
var queryResult = Bucket.Query<object>(query);

foreach (var item in queryResult.Rows)
    Console.WriteLine($"Id: {item.Id}");

But in the queryResult I’m getting the following exception: “A request has been made for a service that is not configured or supported by the cluster. Please check the cluster and enable or add a new node with the requested service: View.”

What can be wrong? Am I missing some configuration in my cluster? I tried to query the view through the management console, and that works fine. I also tried to publish the view to production and query that, but I’m getting the samer error.

@markvincze -

That could happen if your cluster did not enbale the Data service. I am not sure that is possible though, since I believe the Management UI requires at least one node be a Data service node and the SDK will only map View requests to those nodes.

You may want to validate that the node that the View request was mapped to indeed has the Data service configured using Fiddler or some other HTTP debugger.



My bad, it turned out to be unrelated to Views, the connection itself to the cluster wasn’t working. (The instances in the cluster were discovered with their internal hostnames in Google Cloud, so the DNS resolution failed for them. Adding them to the hosts file solved the issue.)
Thanks for the hint!

1 Like