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

While inserting a new fresh document using python sdk "couchbase.n1ql.N1QLError" is raised cause: Duplicate Key <key>', u'code': 12009

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Test Blocker
    • 2.2.6
    • 2.2.3, 2.2.4, 2.2.5
    • library
    • None
    • couchbase==2.2.4
      CB Version = Enterprise Edition 5.0.0 build 2837

    Description

      While inserting a new fresh document using python sdk "couchbase.n1ql.N1QLError" is raised cause: Duplicate Key <key>', u'code': 12009

      PLEASE NOTE: The document is getting created properly in the bucket even after the exception.
      Another observation is that sometimes this exception is not coming and <couchbase.n1ql.N1QLRequest object at 0x1083ce250> is returned properly.

      Step to reproduce:
      1. Load a fresh bucket: default

      2. Using python sdk try to insert few documents:

      from couchbase.bucket import Bucket
      from couchbase.n1ql import N1QLQuery

      cb = Bucket('couchbase://10.142.160.101//default',username="Administrator", password="password")
      cb.n1ql_query('INSERT INTO `default` (KEY, VALUE) VALUES ("4odwalla-juice1",

      { "productId": "odwalla-juice1"}

      )').execute()

      cb.n1ql_query('INSERT INTO `default` (KEY, VALUE) VALUES ("odwalla-juice",

      { "productId": "odwalla-juice1"}

      )').execute()

      cb.n1ql_query('INSERT INTO `default` (KEY, VALUE) VALUES ("abc",

      { "productId": "odwalla-juice1"}

      )').execute()

      Attachments

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

        Activity

          People

            mnunberg Mark Nunberg (Inactive)
            ritesh.agarwal Ritesh Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty