Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-1473

lcb_open errors if bucket name equals auth username

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Major
    • None
    • 3.2.1
    • library
    • 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));
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            avsej Sergey Avseyev
            jake.rawsthorne#1 Jake Rawsthorne [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty