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

using multiple credentials works inconsistently

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 4.5.0
    • 4.5.0
    • query
    • Untriaged
    • Unknown

    Description

      Right now, when accessing a bucket with a password, access always works when "creds" is supplied and includes only a single entry. Access becomes increasingly hindered (requests fail with authorization errors) as the number of entries supplied is increased.

      For example, this alteration of the couchbase/godbc/n1ql/example/example.go works maybe one time in 10.

      package main
       
      import (
              "fmt"
              "io"
              "os"
       
              "github.com/couchbase/godbc/n1ql"
      )
       
      // Illustrates the use of the raw result interface of the N1QL module.
      func main() {
       
       
              db, err := n1ql.OpenExtended("http://localhost:8093")
              if err != nil {
                      fmt.Println("Failed to open.", err.Error())
                      return
              }
       
              ac := "[{\"pass\":\"foo\",\"user\":\"beer-sample\"}, {\"pass\":\"\",\"user\":\"a\"}, {\"pass\":\"\",\"user\":\"b\"}, {\"pass\":\"\",\"user\":\"c\"}, {\"pass\":\"\",\"user\":\"d\"}, {\"pass\":\"\",\"user\":\"e\"}, {\"pass\":\"\",\"user\":\"f\"}, {\"pass\":\"\",\"user\":\"g\"} ]"
              //ac := "[{\"pass\":\"foo\",\"user\":\"beer-sample\"} ]"
              n1ql.SetQueryParams("creds", string(ac))
       
       
              name := "21st Amendment Brewery Cafe"
              ioSrc, err := db.QueryRaw("select * from `beer-sample` where name = ?", name)
       
              // Try this query instead, for a much larger (streaming!) output.
              //ioSrc, err := db.QueryRaw("select * from `beer-sample`")
       
              // For a command rather than a query, try this.
              //ioSrc, err := db.ExecRaw("insert into default(key, value) values ('111', { 'a': 1, 'b': 2 })")
       
              if err != nil {
                      fmt.Printf("ERROR: %s\n", err.Error())
              }
              if ioSrc != nil {
                      defer ioSrc.Close()
                      io.Copy(os.Stdout, ioSrc)
              } else {
                      fmt.Printf("NO OUTPUT.\n")
              }
      }
      

      The current best bet is that this is a server-side problem; the requests that fail don't seem to be mangled client-side.

      Attachments

        Issue Links

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

          Activity

            People

              isha Isha Kandaswamy (Inactive)
              johan.larson Johan Larson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty