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

FTS failure when upgrading to Node.js 4.0.0

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.0.0
    • 4.1.0
    • library
    • None
    • 1

    Description

       

      I’m seeing an error when running our docs search examples after upgrading to Node.js 4.0
      https://github.com/couchbase/docs-sdk-nodejs/blob/release/4.0/modules/howtos/examples/search.js

       

      FYI, I’m running against Couchbase Server 7.0.3.

       

       /node_modules/couchbase/dist/bindingutilities.js:454
                  return new errs.InternalServerFailureError(baseErr, context);
                         ^
       
      InternalServerFailureError: internal server failure
          at errorFromCpp (/node_modules/couchbase/dist/bindingutilities.js:454:20)
          at /node_modules/couchbase/dist/connection.js:99:71 {
        cause: [Error: internal_server_failure] {
          ctxtype: 'search',
          code: 5,
          client_context_id: '40884729-053c-4a03-b112-c3b9473265f5',
          index_name: 'index-hotel-description',
          query: '"{\\"match\\":\\"five-star\\"}"',
          parameters: '{"ctl":{"timeout":75000},"explain":false,"query":"{\\"match\\":\\"five-star\\"}","size":5}',
          method: 'POST',
          path: '/api/index/index-hotel-description/query',
          http_status: 400,
          http_body: '{"error":"rest_index: Query, indexName: index-hotel-description, err: bleve: QueryBleve parsing searchRequest, err: json: cannot unmarshal string into Go value of type map[string]interface {}","request":{"ctl":{"timeout":75000},"explain":false,"query":"{\\"match\\":\\"five-star\\"}","size":5},"status":"fail"}\n',
          last_dispatched_to: '127.0.0.1:8094',
          last_dispatched_from: '127.0.0.1:56998',
          retry_attempts: 0,
          retry_reasons: []
        },
        context: SearchErrorContext {
          index_name: 'index-hotel-description',
          query: '"{\\"match\\":\\"five-star\\"}"',
          parameters: '{"ctl":{"timeout":75000},"explain":false,"query":"{\\"match\\":\\"five-star\\"}","size":5}',
          http_response_code: 400,
          http_response_body: '{"error":"rest_index: Query, indexName: index-hotel-description, err: bleve: QueryBleve parsing searchRequest, err: json: cannot unmarshal string into Go value of type map[string]interface {}","request":{"ctl":{"timeout":75000},"explain":false,"query":"{\\"match\\":\\"five-star\\"}","size":5},"status":"fail"}\n'
        }
      }

      If I revert to SDK 3.2.4 this example works as expected.

      Attachments

        Issue Links

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

          Activity

            tom.kramer Tom Kramer added a comment -

            Meanwhile, are there any recommendations for a workaround? Or is version 4.0.0. simply unusable in order to work with FTS?

            tom.kramer Tom Kramer added a comment - Meanwhile, are there any recommendations for a workaround? Or is version 4.0.0. simply unusable in order to work with FTS?

            This issue was caused by double-encoding of search queries. I have filed a related issue as it also appears there are a number of other places where double-encoding may occur due to a lack of type-safety between the binding and C++ code.

            brett19 Brett Lawson added a comment - This issue was caused by double-encoding of search queries. I have filed a related issue as it also appears there are a number of other places where double-encoding may occur due to a lack of type-safety between the binding and C++ code.

            If Tom Kramer wants to pick this up before the maintenance release, it can be installed off of github, assuming it's merged, right?

            ingenthr Matt Ingenthron added a comment - If Tom Kramer wants to pick this up before the maintenance release, it can be installed off of github, assuming it's merged, right?
            brett19 Brett Lawson added a comment - - edited

            Matt Ingenthron, you certainly can using npm, to install a version of the SDK from GitHub:

            npm install git+ssh://github.com/couchbase/couchnode#master
            

            Note that you will need a build toolchain for this to work, as our prebuilds won't be available yet.

            brett19 Brett Lawson added a comment - - edited Matt Ingenthron , you certainly can using npm, to install a version of the SDK from GitHub: npm install git+ssh://github.com/couchbase/couchnode#master Note that you will need a build toolchain for this to work, as our prebuilds won't be available yet.

            People

              brett19 Brett Lawson
              maria.shodunke Maria Shodunke
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty