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

Execution of encoded_plan of CREATE INDEX statement WITH clause fails

    XMLWordPrintable

Details

    • Triaged
    • Unknown

    Description

      Problem Statement:

      Create Index function is throwing the error"

      GSI CreateIndex() - cause: json: cannot unmarshal string into Go value of type map[string]interface {}" when used with Prepared statements.

      Please note that this issue is seen randomly

      and the prepared statement contained WITH clause as well.

      Steps to reproduce:

       
      1. Create a prepared statement that creates an index as below (Execute from CBQ): 

      prepare p1 from create index ix100 on default(k0,k1) WITH {"defer_build":true};
      

       
      2. [Clean-up step] Delete the prepared statement in CBQ  using: 

      delete from system:prepareds where name = "p1"

      3. The prepared statement result contains the encoded plan and pass on the plan for the below CURL command: 

      curl -v http://localhost:8093/query/service -H "Content-Type: application/json"  -d '{"prepared":"p1", "encoded_plan":"H4sIAAAAAAAA/2SQMU/DMBCF/4r1WEDykDCaCbFQiQGJSgy0ak1yTa2kjrnYJVCZ345sitrAdLrT03vvuwPIVn1N9cp12kIBElbvCAquhETviLXvGeqAi9OCJ3oLZCuCxFe1NV3NZKFepqLb4Lc9m8+kcmz2pqOGhmT1YAaf5XPNDXkoqJo2OnQeEo9s9lDldVzGX/e/8XdM2tPM1jRCwuSpYMayKCDR0seQ3Wl0Sb1uizWiPNvLNeLyR+h0lWhP8Qn//zUMxjaTy7vx29Srpg3x6jXkmp4DxZiyJt/yTHqHDDSYxmofmKBs6DoJT2N6gGNymkm4Umy434kqI4rMJjKZ6K04xl+2hWzLK/E8m9+Lw+K8w+JY4gbxOwAA///mxdg33QEAAA==","creds":[{"user":"Administrator","pass":"XXXX"}]}’
      

      Gives the following error

      {
      "requestID": "32110868-35dc-4ecb-bd97-e06ad0b7a3f5",
      "signature": "null",
      "results": [
      ],
      "errors": [{"code":5000,"msg":"GSI CreateIndex() - cause: json: cannot unmarshal string into Go value of type map[string]interface {}"}],
      "status": "errors",
      "metrics": {"elapsedTime": "2.242916ms","executionTime": "2.169019ms","resultCount": 0,"resultSize": 0,"errorCount": 1}
      }
      
      

      Attachments

        Activity

          People

            Prerna.Manaktala Prerna Manaktala (Inactive)
            anji.narra Anji Narra [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty