Bucket password

Understood, thanks a lot for the information!

Hi,

I’m new to couchbase Server, As I created a new bucket on couchbase server named demo_bucket and trying to connect to this bucket using java code.

Cluster cluster = CouchbaseCluster.create(“localhost”);
Bucket bucket = cluster.openBucket(“demo_bucket”,"");
getting below exception.
com.couchbase.client.java.error.InvalidPasswordException: Passwords for bucket “demo_bucket” do not match.

I don’t know what bucket password is as I’ve no provided any password for bucket and there is no any option to set password for bucket.

Can you please help me?

Hi pankaj,

I’m new to couchbase Server, As I created a new bucket on couchbase server named demo_bucket and trying to connect to this bucket using java code.

Cluster cluster = CouchbaseCluster.create(“localhost”);
Bucket bucket = cluster.openBucket(“demo_bucket”,"");
getting below exception.
com.couchbase.client.java.error.InvalidPasswordException: Passwords for bucket “demo_bucket” do not match.

I don’t know what bucket password is as I’ve no provided any password for bucket and there is no any option to set password for bucket.

Can you please help me?

Bucket passwords are no longer available (at leas for new buckets). You need to create a user (Security tab on UI), and specify a password for that user when you connect.

Note you need an SDK which is compatible with Couchbase Server 5.0 - see SDK Compatibility in the Release Notes

Hi,

Thanks for your reply.

Actually I’m developing a Spring boot application. Below is my Couchconfig class.

@EnableCouchbaseRepositories
@Configuration
public class CouchbaseConfig extends AbstractCouchbaseConfiguration {

	@Value("${couchbase.bucket.name}")
	private String bucketName;

	@Value("${couchbase.bucket.password}")
	private String password;

	@Value("${couchbase.host}")
	private String ip;


	@Override
	protected String getBucketName() {
		return this.bucketName;
	}

	@Override
	protected String getBucketPassword() {
		return this.password;
	}

	@Override
	protected List<String> getBootstrapHosts() {
		return Arrays.asList(this.ip);
	}
}

And this is my yaml file.

couchbase:
  host: localhost
  bucket: 
    name: user_bucket
    password:     

When I’m running my application its giving below exception.

Caused by: com.couchbase.client.java.error.InvalidPasswordException: null
	at com.couchbase.client.java.cluster.DefaultAsyncClusterManager$3.call(DefaultAsyncClusterManager.java:111)
	at com.couchbase.client.java.cluster.DefaultAsyncClusterManager$3.call(DefaultAsyncClusterManager.java:106)
	at rx.internal.util.ActionSubscriber.onNext(ActionSubscriber.java:39)
	at rx.internal.operators.OperatorDoOnEach$1.onNext(OperatorDoOnEach.java:81)
	at rx.internal.operators.OnSubscribeRedo$2$1.onNext(OnSubscribeRedo.java:244)
	at rx.internal.operators.OperatorMerge$MergeSubscriber.emitScalar(OperatorMerge.java:399)
	at rx.internal.operators.OperatorMerge$MergeSubscriber.tryEmit(OperatorMerge.java:357)
	at rx.internal.operators.OperatorMerge$InnerSubscriber.onNext(OperatorMerge.java:852)
	at rx.internal.producers.SingleProducer.request(SingleProducer.java:65)
	at rx.Subscriber.setProducer(Subscriber.java:211)
	at rx.subjects.AsyncSubject.onCompleted(AsyncSubject.java:106)

Hi,

Thankyou for your help. It get resolved.

FYI Some more general description of RBAC related issues is now a pinned post at: V5.0 - NEW Role-Based Authentication - Bucket Passwords, etc

Can you please provide details on how you solved the issue?

Hi

I’m new to couchbase Server, As I created a new bucket on couchbase server named miracle and trying to connect to this bucket using Spring boot.

Application.properties file:

 spring.couchbase.bootstrap-hosts=localhost
 spring.couchbase.bucket.name=test
 spring.couchbase.bucket.password=
 spring.data.couchbase.auto-index=true

getting below exception.
com.couchbase.client.core.endpoint.kv.AuthenticationException: Authentication Failure

I don’t know what bucket password is as I’ve no provided any password for bucket and there is no any option to set password for bucket.

Can you please help me?

Could you specify your Couchbase Server, java-client and spring connector versions?

I am a new user to Couchbase.
I am getting the same error on running it from a java program.
Has this issue been resolved?

getting same error on running even the above java code.

The method authenticate(String, String) is undefined for the type Cluster
I am trying to authenticate in cluster.
I am not able to connect.
Please assist.

hi @tatpum13 please open a new question up as this is unrelated to your question.

thanks

Laura

Hi,

      Even i am getting same type of error , can you tell me how did you solve

i am getting the same error…has this ever fixed?

The documentation and a couple posts above cover solutions. Did you see those? What is it that is not working for you?

I found in other site a solution that worked for me:

“You must now create a user with a name that matches the bucket name and use that user’s password when opening the bucket. The user must have a role with access rights to the bucket.”

This is my yml:

spring:
  couchbase:
    bootstrap-hosts: localhost
    bucket:
      name: my_bucket
      password: my_pwd
  data:
    couchbase:
      auto-index: true
  env:
    timeouts:
      connect: 50000
      socket: 50000

Source:

This is the one helped me too after 2 hours. Take away here is, bucket name and the user name has to match !

I Understood, thanks a lot for sharing. .