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

Eventing N1ql: DELETE with collection failing as `Keyspace not found`

    XMLWordPrintable

Details

    Description

      Build: 7.0.0 build 3594 

      Deploy following handler 

      function OnUpdate(doc,meta) {
          var docId = meta.id;
          var query = INSERT INTO dst_bucket.scope_1.coll_4 ( KEY, VALUE ) VALUES ( $docId ,'Hello World');
      }function OnDelete(meta, options){
          try{
          var docId = meta.id;
          DELETE from `dst_bucket.scope_1.coll_4` USE KEYS $docId;
          }catch(e){
              log(e);
          }
      } 

      Seeing the following error

      2020-11-04T11:11:56.828+00:00 [INFO] {"message":"SDK error : LCB_ERR_INDEX_FAILURE (402) Query error : {\n\"requestID\": \"ae8a6fce-c1fb-4797-b44d-890424c01576\",\n\"clientContextID\": \"10@n1ql.js(OnDelete)\",\n\"errors\": [{\"code\":12003,\"msg\":\"Keyspace not found in CB datastore: default:dst_bucket.scope_1.coll_4 - cause: No bucket named dst_bucket.scope_1.coll_4\"}],\n\"status\": \"fatal\",\n\"metrics\": {\"elapsedTime\": \"48.447017ms\",\"executionTime\": \"48.406053ms\",\"resultCount\": 0,\"resultSize\": 0,\"serviceLoad\": 25,\"errorCount\": 1}\n}\n","stack":"Error\n at OnDelete (n1ql.js:10:5)"} 

      The same query passed from query workbench 

      DELETE from dst_bucket.scope_1.coll_4 USE KEYS "newDocID2" 

      Attachments

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

        Activity

          People

            vikas.chaudhary Vikas Chaudhary
            vikas.chaudhary Vikas Chaudhary
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty