Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-781

NodeJS : CAS value coming from N1QL request causes error at CAS check while doing upsert / mutateIn

    XMLWordPrintable

Details

    • Bug
    • Resolution: User Error
    • Major
    • None
    • None
    • library
    • None
    • 1

    Description

      Using NodeJS 3.0.4 SDK, while performing a CAS check (on subdoc API mutateIn with upsert), the CAS value retrieved from N1QL behaves differently from the CAS value retrieved from KV GET.

      • CAS coming from N1QL : NOK producing :

        Error : document exists

      • CAS coming from KV GET : OK (subdoc mutation performs OK)

      Note: upsert is performed in both cases (no insert).

      In copy 2 samples snippets showing :

      • the error with N1QL: subdoc_with_query_KO.js
      • the workaround (by adding a KV GET): subdoc_with_query_OK.js

      Note : Not possible to reproduce the problem with Java 3.0 SDK

      For subdoc_with_query_KO.js file, error is :

      ERR: { Error: document exists
          at _getWrappedErr (/Users/fabriceleray/node-couchbase-project/node_modules/couchbase/lib/errors.js:864:14)
          at Object.wrapLcbErr (/Users/fabriceleray/node-couchbase-project/node_modules/couchbase/lib/errors.js:1009:20)
          at _conn.mutateIn (/Users/fabriceleray/node-couchbase-project/node_modules/couchbase/lib/collection.js:1121:24)
        cause: LibcouchbaseError { code: 305 },
        context:
         KeyValueErrorContext {
           status_code: 2,
           opaque: 0,
           cas: CbCas<0>,
           key: 'airline_10',
           bucket: 'travel-sample',
           collection: '',
           scope: '',
           context: '',
           ref: '' } }
      (node:5104) [DEP0079] DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated
      

       

      Attachments

        Issue Links

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

          Activity

            People

              brett19 Brett Lawson
              fabrice.leray Fabrice Leray
              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