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

    • Bug
    • Resolution: Fixed
    • Major
    • 2.0.4, 2.1.0
    • None
    • library
    • None
    • 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

          People

            charles.dixon Charles Dixon
            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