I have been playing with Couchbase Analytics using SQL++ ( Installed Using Docker). I’m facing couple of issues:
1- I used this command : connect bucket MusicDB with { “password”: “” }; and I got the following error:
“msg”: “Unauthorized (bucket/password invalid) - please check credentials!”. So for each bucket, there should be a password associated with it? how can I make it passwordless ? I tried to use admin password but with no luck
2- I want to create a shadow dataset on some predefined bucket. However, for instance I got this error:
“msg”: “Shadow can’t be created because Bucket beerBucket is in connected state.” The question is how I can stop the connection to the bucket and be able to create a shadow dataset again.
When creating a bucket in Couchbase Server you can set a bucket password in the “Access Control” section of the dialog. This is the password that is required to connect to the bucket.
You can CONNECT and DISCONNECT a bucket to start and stop shadowing for all datasets on that bucket.
DISCONNECT BUCKET beerBucket;
should do that for you. Once you’ve created your dataset on beerBucket you need to connect beerBucket again to restart shadowing. The whole DDL is available in the online docs.
I did set the password for the bucket for instance, I have the bucket “testB” and the password is “123” . Then, I did the following:
cbq> create bucket testBU with { “bucket”: “testB”, “nodes”: “127.0.0.1” };
cbq> create shadow dataset test on testBU;
cbq> connect bucket testBU with { “password”: “123” };
However, I got the same error “Unauthorized (bucket/password invalid) - please check credentials!”.
Then, I tried :
cbq> connect bucket testBU with { “password”: 123 };
Just tried this locally by creating a testB bucket with the password 123 and pasting your statements.
That seemed to work.
One difference in what I did was to use used the workbench on http://localhost:8095/ instead of cbq.
Could you try that?
Also, I might have a different version of Couchbase Server.
Which version do you use?
download the installer from the “Extensions” tab on the download page and unzip it or
use the couchbasesamples/analytics-demo docker image?
I’m asking as the Analytics instance on the couchbasesamples/analytics-demo image should connect to a Couchbase Server that is installed on the same image. This is different from the Couchbase Server that you are running if you have followed https://developer.couchbase.com/documentation/server/current/install/getting-started-docker.html (which could explain why the bucket is not found).
I’m following the analytics tutorial and am getting something similar on Analytics Developer Preview 4 whereby at the CONNECT BUCKET step I get an authorization failure:
“Incorrect credentials or bucket beer-sample does not exist”
To resolve this I have worked out that I need to supply both a username and password to the connect bucket step for a user that has analytics access. E.g.
CONNECT BUCKET beerBucket WITH {“username”: “x”, “password”:“y”};
if you are running the Developer Preview 4 you should have your data nodes in the same cluster as your analytics nodes and you should not need to provide credentials when connecting to a bucket. This assumes the the connected user has the privileges to access the bucket data and the analytics service. Both are true for the administrator accounts.