Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bucket password in Couchbase

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.

like image 500
dead programmer Avatar asked Jul 24 '18 10:07

dead programmer


People also ask

What is bucket in Couchbase?

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.

How do I change my Couchbase password?

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.

How do I check my Couchbase bucket size?

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.


1 Answers

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:

  1. Open your couchBase admin console: http://<couchBase-host>:8091/ui/index.html#!/overview
  2. Click on 'Security'
  3. click on 'Add user'

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.

like image 195
juanlumn Avatar answered Sep 29 '22 16:09

juanlumn