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

Cannot query nodes with 2.0.3 version of golang SDK

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.4, 2.1.0
    • Component/s: library
    • Labels:
      None
    • Story Points:
      1

      Description

      we ran into an issue with the 2.0.3 golang SDK for running queries
      Code for it
      // Use query
      fmt.Println("Querying data")
      queryStr := "SELECT * FROM " + bucketName + " WHERE $1 IN interests"
      params := make(map[string]interface{}, 1)
      params["interest"] = "African Swallows"
      fmt.Println(queryStr)
      qr, err := cluster.Query(queryStr, &gocb.QueryOptions{NamedParameters: params})
      // rows, err := bucket.ExecuteN1qlQuery(query)
      if err != nil

      { fmt.Println(err) os.Exit(1) }

      var row interface{}
      for qr.Next() {
      err := qr.Row(&row)
      if err != nil

      { fmt.Printf("row error: %s\n", err) os.Exit(1) }

      fmt.Printf("result: %s\n", row)
      }
      This gave this error
      Post http://cb-0000.cb.ceced4a6-505d-49cc-a9a1-6d6a27a766cf.dataplane.nonprod-project-avengers.com:18093/query/service: net/http: HTTP/1.x transport connection broken: malformed HTTP response “\x15\x03\x01\x00\x02\x02\x16” |

      {“statement”:“PREPARE SELECT * FROM Couchbase_Cloud_Bucket WHERE $1 IN interests”,“client_context_id”:“1108bd5d-b30c-4a6d-8c63-b0604d101633”,“endpoint”:“[http://cb-0000.cb.ceced4a6-505d-49cc-a9a1-6d6a27a766cf.dataplane.nonprod-project-avengers.com:18093|http://cb-0000.cb.ceced4a6-505d-49cc-a9a1-6d6a27a766cf.dataplane.nonprod-project-avengers.com:18093/]”}

      exit status 1expected it to post to https instead of http.

      Cluster connection details
      endpoint := "cb.ceced4a6-505d-49cc-a9a1-6d6a27a766cf.dataplane.nonprod-project-avengers.com"
      bucketName := "Couchbase_Cloud_Bucket"
      username := "iegomez"
      password := "password1"
      // bucketName := "thor"
      cluster, err := gocb.Connect(
      "couchbases://"endpoint"?ssl=no_verify",
      gocb.ClusterOptions

      { Username: username, Password: password, }

      )
      if err != nil

      { panic(err) }

        Attachments

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

          Activity

          Hide
          build-team Couchbase Build Team added a comment -

          Build couchbase-server-7.0.0-1878 contains gocbcore commit ac4efa4 with commit message:
          GOCBC-838: If ssl is enabled then use https for http endpoints

          Show
          build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.0-1878 contains gocbcore commit ac4efa4 with commit message: GOCBC-838 : If ssl is enabled then use https for http endpoints
          Hide
          build-team Couchbase Build Team added a comment -

          Build couchbase-server-6.6.0-7624 contains gocbcore commit ac4efa4 with commit message:
          GOCBC-838: If ssl is enabled then use https for http endpoints

          Show
          build-team Couchbase Build Team added a comment - Build couchbase-server-6.6.0-7624 contains gocbcore commit ac4efa4 with commit message: GOCBC-838 : If ssl is enabled then use https for http endpoints
          Hide
          build-team Couchbase Build Team added a comment -

          Build sync_gateway-3.0.0-52 contains gocbcore commit ac4efa4 with commit message:
          GOCBC-838: If ssl is enabled then use https for http endpoints

          Show
          build-team Couchbase Build Team added a comment - Build sync_gateway-3.0.0-52 contains gocbcore commit ac4efa4 with commit message: GOCBC-838 : If ssl is enabled then use https for http endpoints

            People

            Assignee:
            charles.dixon Charles Dixon
            Reporter:
            rahul.mani Rahul Mani (Inactive)
            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