Details
-
Bug
-
Resolution: Incomplete
-
Major
-
None
-
3.2.1
-
None
-
1
Description
This might be a known issue
Initially found in couchbase-rs https://github.com/couchbaselabs/couchbase-rs/issues/59
Create a bucket and user with the same name. During bootstrap the server sees a bucket with the given username and assumes really old auth is being used so sends back a cluster config with the bucket which lcb associates with the instance. When lcb_open is called it returns an error "The instance has been associated with the bucket already, sorry"
lcb_INSTANCE *instance;
|
lcb_CREATEOPTS *create_options = nullptr;
|
|
std::string user("travel-sample");
|
std::string password("password");
|
std::string bucket("travel-sample");
|
std::string connstr = "couchbase://localhost";
|
|
lcb_createopts_create(&create_options, LCB_TYPE_CLUSTER);
|
lcb_createopts_connstr(create_options, connstr.c_str(), connstr.size());
|
lcb_createopts_credentials(create_options, user.c_str(), user.size(), password.c_str(), password.size());
|
lcb_create(&instance, create_options);
|
lcb_createopts_destroy(create_options);
|
|
ASSERT_STATUS_EQ(LCB_SUCCESS, lcb_connect(instance));
|
ASSERT_STATUS_EQ(LCB_SUCCESS, lcb_wait(instance, LCB_WAIT_DEFAULT));
|
ASSERT_STATUS_EQ(LCB_SUCCESS, lcb_get_bootstrap_status(instance));
|
ASSERT_STATUS_EQ(LCB_SUCCESS, lcb_open(instance, bucket.c_str(), bucket.size()));
|
ASSERT_STATUS_EQ(LCB_SUCCESS, lcb_wait(instance, LCB_WAIT_DEFAULT));
|