I encountered a problem that the bucket is inaccessible when using N1QL(either JAVA API and neither CQB), but it is accessible when using bucket.get(). Interestingly, the bucket is visible when using the web portal, and so does the document in the bucket.
The error message got from the server is “code”: 12003, “msg”: "Keyspace not found keyspace XXXX.
The bucket is password protected, and I am not sure about if this causes the problem as I have googled something form the internet, stating that due to the password,
In addition, I use the cbq and got the same error code and message.
My development is listed in below
JAVA JDK 1.7
JAVA SDK 2.1
Couchbase 4.0 and this is installed on the ubuntu system
There are two buckets in the couchbase with the name ChartFlow and ChartFlowPhoto. I was trying to use N1QL to create index on it, but it still got the problem.
In quote of “may be you can try to using bucket_name to escape special characters.”, do you recommend me that I should use bucket_ChartFlow and bucket_ChartFlowPhoto?
The actual exection is in the QueryResult queryResult = bucket1.query( statements.get(0) );. I taked it out the statements.get(0) and put it into the CBQ, and got the same error code saying that bucket1 or bucket2 are missing from the name space.
I’m also facing the same problem with N1ql queries now. Weird thing is that it was working fine till the last restart of the server and suddenly it started throwing this error.
I’m launching cbq tool with this param : -engine="http://user:password@host:8093/
N1ql query throws an error that the keyspace not found. If I remove the authentication, it works fine. But what do I do get it working again with authentication?
I got same problem. After restart, it suddenly failed with error code: 12003 keyspace not found. I tried in Query GUI (I use CB 4.5 Beta), same problem. If I remove the password, everything works. So this is not a problem in java code.
Hello, I have seen this problem a few times, but I’ve had trouble reproducing it, and it always went away after server restart. How consistently are you able to reproduce it? You might be able to help us debug it.
For me, when the bucket had a password, it would not appear in the list of ‘select * from system:keyspaces’, but if I removed the password, it would appear again. Do you see that?
When running queries against protected buckets, you can’t access/perform any operation on the bucket unless the query has the bucket auth credentials. There are 2 ways for the query engine to get this information.
It can either use the user credentials (Administrator password)
or the protected bucket credentials.
If it contains the user credentials, for example Administrator password, then it will be able to discover all the authenticated buckets in /pools.
This means that query is a trusted service but query clients aren’t, therefore, for the clients to access the protected buckets they need provide the right credentials.
Let’s say that your cluster’s Administrator password is “c_password” and your “default” bucket has a password of “b_password”.
There are 2 ways to allow access / see the buckets when querying
Using the new cbq shell in Couchbase 4.5 :
Using –u –p
$ ./cbq –e=couchbase://127.0.0.1 –u=Administrator -p=c_password
cbq > select * from system:keyspaces;
(This will list all buckets including protected buckets)
Using –creds
$ ./cbq –e=couchbase://127.0.0.1
cbq > select * from system:keyspaces;
(This will list only non protected buckets)
…
cbq > \SET -creds default:b_password;
(This will list all buckets including protected bucket default)
Using the rest api:
Using the admin credentials :
curl -v http://localhost:8093/query/service -d ‘statement=select * from system:keyspaces&creds=[{“user”:“Administrator”, “pass”:“c_password”}]’
Using bucket credentials :
curl -v http://localhost:8093/query/service -d ‘statement=select * from system:keyspaces&creds=[{“user”:“default”, “pass”:“b_password”}]’
I don’t believe this issue relates to credentials. I’ve spent all day with versions 4.0 and 4.5, and in every case “select * from system:keyspaces” returns the name of every bucket, whether or not it has a password, whether from cbq or the 4.5 query workbench. Furthermore, when I try to access a password-protected bucket without credentials, the error I see is 10000 - Authorization Failed.
In contrast, with the behavior that I and the users above experienced, a password-protected bucket no longer shows up in ‘select * from system:keyspaces’, and referring to it yields error 12003 - Keyspace not found.
So I think we have a real bug here, we just need to figure out how to reproduce it. Perhaps one of the people above can provide log files.