Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-12751

Replace on a locked doc gives Key not found error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0.2, 4.0.0
    • 3.0.1
    • couchbase-bucket
    • Security Level: Public
    • None
    • CB Server 3.0.1

      $ pip list | grep couchbase
      couchbase (1.2.4)
      $ rpm -qa | grep couchbase
      libcouchbase2-core-2.4.3-1.el6.x86_64
      couchbase-server-3.0.1-1444.x86_64
      libcouchbase-devel-2.4.3-1.el6.x86_64
    • Untriaged
    • Unknown

    Description

      Using the python SDK a customer has discovered that replacing a value on a locked document results in a key not found error. Mark Nunberg investigated from the SDK perspective and determined that the server is returning this incorrect error.

      Example:
      python
      Python 2.7.8 (default, Oct 19 2014, 16:02:00)
      [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin
      Type "help", "copyright", "credits" or "license" for more information.
      >>> from couchbase.bucket import Bucket
      >>> b = Bucket('couchbase://localhost')
      >>> b.upsert('x', 'value1')
      OperationResult<RC=0x0, Key=u'x', CAS=0x44c778fbec280000>
      >>> b.replace('x', 'value2')
      OperationResult<RC=0x0, Key=u'x', CAS=0x2906244eee280000>
      >>> b.lock('x', ttl=30)
      ValueResult<RC=0x0, Key=u'x', Value=u'value2', CAS=0xb5784741f0280000, Flags=0x2000000>
      >>> b.replace('x', 'value3')
      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "couchbase/bucket.py", line 401, in replace
      persist_to=persist_to, replicate_to=replicate_to)
      couchbase.exceptions._NotFoundError_0xD (generated, catch NotFoundError): <Key=u'x', RC=0xD[The key does not exist on the server], Operational Error, Results=1, C Source=(src/multiresult.c,282)>
      >>> b.upsert('x', 'value3')
      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "couchbase/bucket.py", line 361, in upsert
      persist_to, replicate_to)
      couchbase.exceptions._KeyExistsError_0xC (generated, catch KeyExistsError): <Key=u'x', RC=0xC[The key already exists in the server. If you have supplied a CAS then the key exists with a CAS value different than specified], Operational Error, Results=1, C Source=(src/multiresult.c,282)>
      >>>

      Attachments

        Issue Links

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

          Activity

            People

              trond Trond Norbye
              ianmccloy Ian McCloy (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty