com.couchbase.client.java.error.InvalidPasswordException

java

#1

Hi,

I am Using below code to connect to my couchbase server :-

Cluster cluster = CouchbaseCluster.create("couchbase://localhost");
Bucket bucket = cluster.openBucket("sample");
N1qlQuery nQuery = N1qlQuery.simple("select * from `sample`");
N1qlQueryResult nResult = bucket.query(nQuery);

I am getting below exception :-

Apr 25, 2018 11:34:39 AM com.couchbase.client.core.CouchbaseCore <init>
INFO: CouchbaseEnvironment: {sslEnabled=false, sslKeystoreFile='null', sslKeystorePassword='null', queryEnabled=false, queryPort=8093, bootstrapHttpEnabled=true, bootstrapCarrierEnabled=true, bootstrapHttpDirectPort=8091, bootstrapHttpSslPort=18091, bootstrapCarrierDirectPort=11210, bootstrapCarrierSslPort=11207, ioPoolSize=4, computationPoolSize=4, responseBufferSize=16384, requestBufferSize=16384, kvServiceEndpoints=1, viewServiceEndpoints=1, queryServiceEndpoints=1, searchServiceEndpoints=1, ioPool=NioEventLoopGroup, coreScheduler=CoreScheduler, eventBus=DefaultEventBus, packageNameAndVersion=couchbase-java-client/2.2.8 (git: 2.2.8, core: 1.2.9), dcpEnabled=false, retryStrategy=BestEffort, maxRequestLifetime=75000, retryDelay=ExponentialDelay{growBy 1.0 MICROSECONDS, powers of 2; lower=100, upper=100000}, reconnectDelay=ExponentialDelay{growBy 1.0 MILLISECONDS, powers of 2; lower=32, upper=4096}, observeIntervalDelay=ExponentialDelay{growBy 1.0 MICROSECONDS, powers of 2; lower=10, upper=100000}, keepAliveInterval=30000, autoreleaseAfter=2000, bufferPoolingEnabled=true, tcpNodelayEnabled=true, mutationTokensEnabled=false, socketConnectTimeout=1000, dcpConnectionBufferSize=20971520, dcpConnectionBufferAckThreshold=0.2, dcpConnectionName=dcp/core-io, callbacksOnIoPool=false, queryTimeout=75000, viewTimeout=75000, kvTimeout=2500, connectTimeout=5000, disconnectTimeout=25000, dnsSrvEnabled=false}
Apr 25, 2018 11:34:40 AM com.couchbase.client.core.endpoint.AbstractEndpoint$2 operationComplete
WARNING: [null][KeyValueEndpoint]: Authentication Failure.
Apr 25, 2018 11:34:40 AM com.couchbase.client.core.endpoint.ResponseStatusConverter fromHttp
WARNING: Unknown ResponseStatus with Protocol HTTP: 401
Apr 25, 2018 11:34:40 AM com.couchbase.client.core.endpoint.ResponseStatusConverter fromHttp
WARNING: Unknown ResponseStatus with Protocol HTTP: 401
com.couchbase.client.java.error.InvalidPasswordException: Passwords for bucket "e_sqoe_udp_latency" do not match.
	at com.couchbase.client.java.CouchbaseAsyncCluster$OpenBucketErrorHandler.call(CouchbaseAsyncCluster.java:480)
	at com.couchbase.client.java.CouchbaseAsyncCluster$OpenBucketErrorHandler.call(CouchbaseAsyncCluster.java:463)
	at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:99)
	at rx.internal.operators.OperatorMap$1.onError(OperatorMap.java:48)
	at rx.observers.Subscribers$5.onError(Subscribers.java:229)
	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:191)
	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:162)
	at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Can anyone please help me !

Thanks in advance.


#2

What server version are you using? I think you forgot to pass authentication credentials to the cluster object.

Read more at https://blog.couchbase.com/new-sdk-authentication/ and https://developer.couchbase.com/documentation/server/5.1/sdk/java/sdk-authentication-overview.html


#3

Server version - Enterprise Edition 5.1.0 build 5552
Java client version - 2.2.8


#4

And how did you setup authentication? The exception clearly says that you have problems with your password. How did you pass it into the client?


#5

I am doing it as below :

Bucket bucket = cluster.openBucket(“sample”, “password”);


#6

your sample in the topic was different, could you read the documentation and try the samples from there?


#7

Thanks for your support.