Bucket password


#1

Hi, I am currently using buckets with passwords in my production environments, however I see that 5.0 has removed the “bucket password”, does this means that I cannot use rolling upgrade?

i.e. I will need to

  1. stop all services
  2. upgrade CB to 5.0
  3. update the authentication in application
  4. start service

Please correct me if I’m wrong. Thanks a lot!


#2

Create user in Security and use that.


#3

I believe you can still use an online upgrade. Pre 5.x buckets are upgraded in to the RBAC system, meaning that a legacy bucket username is created on upgrade. Your application should continue to authenticate to the old bucket using just the bucket name and password.

Any new buckets created after the 5.0 upgrade will need explicit usernames creating (which can match the bucket name if you wish) via the Security tab.


#4

Understood, thanks a lot for the information!


#5

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?


#6

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?


#7

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


#8

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)

#9

Hi,

Thankyou for your help. It get resolved.


#10

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


#11

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


#12

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?


#13

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


#14

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?


#15

getting same error on running even the above java code.


#16

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.


#17

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

thanks

Laura


#18

Hi,

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