Uploaded image for project: 'Couchbase Go SDK'
  1. Couchbase Go SDK
  2. GOCBC-341

When server returns unexpected error with a string, gocb.ExecuteSearchQuery returns json unmarshal error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.1
    • Component/s: None
    • Labels:
      None

      Description

      with gocb 1.4, gocbcore v7,
      When fts query server returns error like this

      search request rejected","request":{"ctl":

      {"consistency":null,"timeout":9499}

      ,"explain":true,"facets":null,"fields":["*"],"from":0,"highlight":

      {"fields":null,"style":null}

      ,"includeLocations":false,"pindexNames":["ftsIndex_6dc7bf54169cbbda_f4e0a48a","ftsIndex_6dc7bf54169cbbda_18572d87"],"query":

      {"query":"SampleValue1"}

      ,"size":10,"sort":["-_score"]},"status":"fail"}

      gocb.ExecuteSearchQuery returns "json: cannot unmarshal string into Go struct field searchResponse.status of type gocb.SearchResultStatus"

      Expected: Go SDK needs to handle the case where server response can not be parsed as searchResponse.status rather than returning unmarshal error. maybe Go sdk needs to check why the server error is considered as string type.

        Attachments

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

          Activity

          Hide
          charles.dixon Charles Dixon added a comment -

          Hi Jae,

          Can you send me a Go example of the query being run here?

          Show
          charles.dixon Charles Dixon added a comment - Hi Jae, Can you send me a Go example of the query being run here?
          Hide
          jaekwon.park Jae Park [X] (Inactive) added a comment -
          Show
          jaekwon.park Jae Park [X] (Inactive) added a comment - This is exact line that returns unmarshal error https://github.com/couchbaselabs/sdk-qe/blob/master/functional-tests/go-functional/helper/helper.go#L182 hope this helps.
          Hide
          build-team Couchbase Build Team added a comment -

          Build couchbase-server-6.5.0-1487 contains gocb commit fa9ad04 with commit message:
          GOCBC-341: Fix ExecuteSearchQuery json unmarshal error

          Show
          build-team Couchbase Build Team added a comment - Build couchbase-server-6.5.0-1487 contains gocb commit fa9ad04 with commit message: GOCBC-341 : Fix ExecuteSearchQuery json unmarshal error
          Hide
          build-team Couchbase Build Team added a comment -

          Build sync_gateway-2.6.0-2 contains gocb commit fa9ad04 with commit message:
          GOCBC-341: Fix ExecuteSearchQuery json unmarshal error

          Show
          build-team Couchbase Build Team added a comment - Build sync_gateway-2.6.0-2 contains gocb commit fa9ad04 with commit message: GOCBC-341 : Fix ExecuteSearchQuery json unmarshal error
          Hide
          build-team Couchbase Build Team added a comment -

          Build sync_gateway-2.5.1-8 contains gocb commit fa9ad04 with commit message:
          GOCBC-341: Fix ExecuteSearchQuery json unmarshal error

          Show
          build-team Couchbase Build Team added a comment - Build sync_gateway-2.5.1-8 contains gocb commit fa9ad04 with commit message: GOCBC-341 : Fix ExecuteSearchQuery json unmarshal error

            People

            • Assignee:
              charles.dixon Charles Dixon
              Reporter:
              jaekwon.park Jae Park [X] (Inactive)
            • 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

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.