Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-405

Index already exists error when recreating a bucket

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • None

    Description

      I am seeing this error after updating to couchbase (2.2.4) pip package

      Server version (5.0.0-2873, 3 nodes)

      Steps to repro

      • Delete bucket with Primary Index defined
      • Recreate the bucket
      • Create an index using the code below

       
      b = Bucket("couchbase://{}/{}".format(self.host, bucket), password='password')
      found_ids = []
      b.n1ql_query("CREATE PRIMARY INDEX ON `{}`".format(bucket)).execute()
      for row in b.n1ql_query("SELECT meta(`{}`) FROM `{}`".format(bucket, bucket)):
          log_info(row)
          if row["$1"]["id"].startswith(prefix):
          found_ids.append(row["$1"]["id"])
       
      Sometimes (more often than not), the N1QL index creation fails with the following error.
      E HTTPError: <RC=0x3B[HTTP Operation failed. Inspect status code for details], HTTP Request failed. Examine 'objextra' for full result, Results=1, C Source=(src/http.c,140), OBJ=ViewResult<rc=0x3B[HTTP Operation failed. Inspect status code for details], value={u'status': u'errors', u'errors': {u'msg': u'GSI CreatePrimaryIndex() - cause: Fail to create index or replcia on some or all indexer nodes. Error=Index data-bucket.#primary already exists\n.', u'code': 5000}, u'results': [], u'metrics': {u'elapsedTime': u'178.829897ms', u'executionTime': u'178.812894ms', u'resultSize': 0, u'resultCount': 0, u'errorCount': 1}, u'requestID': u'9931cc9e-e439-4cf4-9bf2-0c2b10003eaa', u'signature': None}, http_status=500>>
       
       

      Attachments

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

        Activity

          People

            Seth.Rosetter Seth Rosetter (Inactive)
            Seth.Rosetter Seth Rosetter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty