The Query service is not enabled or no node in the cluster supports it

com.couchbase.client.core.CouchbaseCore$3.handleEventException Exception while Handling Request Events RequestEvent{request=null}, com.couchbase.client.core.ServiceNotAvailableException: The Query service is not enabled or no node in the cluster supports it.

i am getting the following exception each time i am trying to use bucket.query();

any help please ??

when i am using bucket.query on the bean of the bucket, i am not able to query that bean ,i.e, i am not able to use bucket.query on that bean more than once.
whereas when i am opening bucket in my code using cluster bean, everything is working fine.
I need to know why??

I am having the same issue. Did you happen to resolve this?

@DavidActualX what is your config and what server version are you using?

Version: 4.0.0-2213 DEV Edition (build-2213)

Cluster State ID: 017-060-613

I am using a single node cluster on an Azure VM running Ubuntu 14.04.2 LTS

I tried to get config information for you but I can’t seem to get the command line interface to work.

It doesn’t like the following:
./couchbase-cli -c http://localhost

nor

./couchbase-cli --cluster=http://localhost

couchbase-cli is not for N1QL queries. It can be used in this form:

vagrant@precise64:~$ /opt/couchbase/bin/couchbase-cli bucket-list -c localhost -u Administrator -p password
cache
 bucketType: memcached
 authType: sasl
 saslPassword: cache
 numReplicas: 0
 ramQuota: 715128832
 ramUsed: 0
default
 bucketType: membase
 authType: sasl
 saslPassword: 
 numReplicas: 1
 ramQuota: 536870912
 ramUsed: 81874352

If you want to query, use the “cbq” command from the same directory.

I wasn’t trying to use the couchbase-cli for N1QL queries. I was trying to the get configuration information that you asked for.

@DavidActualX oh sorry, I meant the configuration code for your java code!

My first attempt this morning was to try the CLI on the server… that failed due to not enabling the query checkbox on cluster creation (I am assuming from the other thread).

I then tried to run N1QL queries in Java.

I found an example in the documentation that when I ran I got the same error that akshay received.

I also found somewhere else in the documentation…

System.setProperty("com.couchbase.queryEnabled", "true");

When I use that before cluster create I get passed the “Query service is not enabled…”

It tries and tries and… then times out. I was going to look for another thread or start a new one. I think I’ve used this one up :wink:

@DavidActualX the queryEnabled is not needed if you run 4.0 beta, this setting will be deprecated for the upcoming 2.2… it was actually used to manually enabled when we were shipping N1QL binaries alongside with the server as experimental.

If you pick a 4.0 and you enable the query and index services, it will pick them up without anything to do on your side.

I understand what you are saying, but if you didn’t enable the index and query services during initial setup this queryEnabled setProperty is the only way to get passed the query service is not enabled issue.

@DavidActualX no it’s not, because this will only force the client to look on port 8093 for the query service, but if the server doesn’t have it enabled nothing is running on that port. The reason why we deprecated this option is that it is now picked up automatically through the server side config (but all of those make you need to enable the query and indexing service on the cluster).