I’m trying to connect to couchbase server 5.0 using couchbase PHP SDK.
try{
// Establish username and password for bucket-access
// $authenticator = new \Couchbase\PasswordAuthenticator();
// $authenticator->username($cb_login)->password($cb_pass);
// pr($authenticator, 1);
// Connect to Couchbase Server
$cluster = new CouchbaseCluster("couchbase://".$cb_host);
// Authenticate, then open bucket
// $cluster->authenticate($authenticator);
$cluster->authenticateAs( $cb_login, $cb_pass );
$this->couchObj = $cluster->openBucket($cb_bucket);
} //catch exception
catch(Exception $e) {
echo "Couchbase Connection Error:".$e->getMessage();
die();
}
I tried both ways using authenticator
$authenticator = new \Couchbase\PasswordAuthenticator();
$authenticator->username($cb_login)->password($cb_pass);
and using direct call
$cluster->authenticateAs( $cb_login, $cb_pass );
but none worked. here’s the log
[Fri Dec 08 08:05:14.053507 2017] [php7:notice] [pid 18] [client 10.129.0.1:44002] COUCHBASE Connected:\n
[Fri Dec 08 08:05:14.060527 2017] [php7:notice] [pid 18] [client 10.129.0.1:44002] [cb,EROR] (negotiation L:152 I:6) <darkgreenmonkey.xxxxxx-1.svc.cluster.local:11210> (CTX=0x560f8ad3f9c0,sasl,SASLREQ=0x560f8ad38d50) Error: 0x2, Provided credentials not allowed for bucket
[Fri Dec 08 08:05:14.060558 2017] [php7:notice] [pid 18] [client 10.129.0.1:44002] [cb,EROR] (cccp L:165 I:6) NOHOST:NOPORT (CTX=(nil),) Could not get configuration: LCB_AUTH_ERROR (0x02)
[Fri Dec 08 08:05:14.060572 2017] [php7:notice] [pid 18] [client 10.129.0.1:44002] [cb,EROR] (bootstrap L:170 I:6) Failed to bootstrap client=0x560f8ad3de20. Error=LCB_AUTH_ERROR (0x02), Message=No more bootstrap providers remain
[Fri Dec 08 08:05:14.060673 2017] [php7:notice] [pid 18] [client 10.129.0.1:44002] [cb,EROR] (pcbc/pool L:105) Failed to bootstrap LCB connection: LCB_AUTH_ERROR: Authentication failed. You may have provided an invalid username/password combination. I=0x560f8ad3de20
Still getting the same issue. script is able to connect to couchabse server but isn’t authenticating. not sure what is the issue. ANy help will be appriciated
Here are rights to user under couchbase : Screenshot by Lightshot ( bucket name changed in screenshot for security reasons )
My server PHP Couchbase lib info:
couchbase support enabled
extension version 2.4.2
libcouchbase runtime version 2.8.3 (git: 8ce52f9294cfef59b9ff44f3cfc18cc3ca8c2860)
libcouchbase headers version 2.8.3 (git: 8ce52f9294cfef59b9ff44f3cfc18cc3ca8c2860)
igbinary transcoder disabled (install pecl/igbinary and rebuild pecl/couchbase)
zlib compressor enabled