I am creating a demo project for reative programming with springboot and Couchbase. I have set the below properties in application.properties file:
spring.couchbase.bootstrap-hosts=localhost
spring.couchbase.bucket.name=vanquish
spring.couchbase.bucket.password=
spring.data.couchbase.repositories.type=auto
As I don't have any bucket level password while creating it. Still, service is not able to start because of below exception:
Caused by: com.couchbase.client.java.error.InvalidPasswordException: Passwords for bucket "vanquish" do not match.
at com.couchbase.client.java.CouchbaseAsyncCluster$OpenBucketErrorHandler.call(CouchbaseAsyncCluster.java:651) ~[java-client-2.5.9.jar:na]
at com.couchbase.client.java.CouchbaseAsyncCluster$OpenBucketErrorHandler.call(CouchbaseAsyncCluster.java:634) ~[java-client-2.5.9.jar:na]
at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$4.onError(OperatorOnErrorResumeNextViaFunction.java:140) ~[rxjava-1.3.8.jar:1.3.8]
at rx.internal.operators.OnSubscribeMap$MapSubscriber.onError(OnSubscribeMap.java:88) ~[rxjava-1.3.8.jar:1.3.8]
at rx.observers.Subscribers$5.onError(Subscribers.java:230) ~[rxjava-1.3.8.jar:1.3.8]
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.checkTerminated(OperatorObserveOn.java:273) ~[rxjava-1.3.8.jar:1.3.8]
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:216) ~[rxjava-1.3.8.jar:1.3.8]
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55) ~[rxjava-1.3.8.jar:1.3.8]
I tried searching all properties but not able to find any relevant property to set username and password or setting the password in couchbase for the bucket.
A Bucket is a Couchbase specific term that is roughly analogous to a 'database' in traditional RDBMS terms. A Bucket provides a container for grouping your data, both in terms of organisation and grouping of similar data and resource allocation.
The password can be changed using the couchbase-cli tool. Dipti: changing the password is different from resetting it though. I thought that's what was being asked about. We currently don't have a way to reset the password using cli.
There is now easy way to get this. You should use REST API of bucket stats (or cbstats https://docs.couchbase.com/server/6.6/cli/cbstats/cbstats-all.html, ep_kv_size, ep_value_size) and get from there. If really need N1QL same REST call can be used with N1QL CURL() function described here.
Assuming that you're using a couchBase version 5.x:
According to the couchBase documentation:
To access cluster-resources, Couchbase Server users — administrators and applications — must specify a username and password.
Steps to follow:
http://<couchBase-host>:8091/ui/index.html#!/overview
In the 'Add user' form add these parameters:
User Name: This must be the bucket name, in your case vanquish
.
Password: Set the password that you want, this must be the value set in spring.couchbase.bucket.password
.
Roles: Go to Roles -> Bucket Roles -> Bucket Admin and select your bucket, in your case vanquish
.
Click on 'Save'.
After doing this and set the password in spring.couchbase.bucket.password
it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With