Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-2997

SDK returns false when checking for exist in Couchbase 7

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.7.25, 2.7.26
    • 2.7.27
    • None
    • None
    • Couchbase .Net SDK 2.7.x
      Couchbase Server 7.0.2
    • 1

    Description

       

      Checking for exist always returns false on the .net SDK.

      it does work on equivalent Java SDK.

      recreation code

      var servers = new List<Uri>
       {
       new Uri("http://localhost")
       };
      var useSsl = false;
      var cluster = new Cluster(new ClientConfiguration
       {
      Servers = servers,
       UseSsl = useSsl
       });
       cluster.Authenticate(
       new PasswordAuthenticator("Administrator", "password"));
      var bucket = await cluster.OpenBucketAsync("beer-sample");
       
       Console.WriteLine(bucket.Get<string>("21st_amendment_brewery_cafe"));
       Console.WriteLine(bucket.Exists("21st_amendment_brewery_cafe"));
      

      Output:

      {"id":"21st_amendment_brewery_cafe","cas":1634226326775201792,"token":"mt{bRef=, vbID= -1, vbUUID=-1, seqno=-1}","content":"\"{\\\"name\\\":\\\"21st Amendment Brewery Cafe\\\",\\\"city\\\":\\\"San Francisco\\\",\\\"state\\\":\\\"California\\\",\\\"code\\\":\\\"94107\\\",\\\"country\\\":\\\"United States\\\",\\\"phone\\\":\\\"1-415-369-0900\\\",\\\"website\\\":\\\"http://www.21st-amendment.com/\\\",\\\"type\\\":\\\"brewery\\\",\\\"updated\\\":\\\"2010-10-24 13:54:07\\\",\\\"description\\\":\\\"The 21st Amendment Brewery offers a variety of award winning house made brews and American grilled cuisine in a comfortable loft like setting. Join us before and after Giants baseball games in our outdoor beer garden. A great location for functions and parties in our semi-private Brewers Loft. See you soon at the 21A!\\\",\\\"address\\\":[\\\"563 Second Street\\\"],\\\"geo\\\":{\\\"accuracy\\\":\\\"ROOFTOP\\\",\\\"lat\\\":37.7825,\\\"lon\\\":-122.393}}\""}
      False
      

      Expected Output:

      {"id":"21st_amendment_brewery_cafe","cas":1634226326775201792,"token":"mt{bRef=, vbID= -1, vbUUID=-1, seqno=-1}","content":"\"{\\\"name\\\":\\\"21st Amendment Brewery Cafe\\\",\\\"city\\\":\\\"San Francisco\\\",\\\"state\\\":\\\"California\\\",\\\"code\\\":\\\"94107\\\",\\\"country\\\":\\\"United States\\\",\\\"phone\\\":\\\"1-415-369-0900\\\",\\\"website\\\":\\\"http://www.21st-amendment.com/\\\",\\\"type\\\":\\\"brewery\\\",\\\"updated\\\":\\\"2010-10-24 13:54:07\\\",\\\"description\\\":\\\"The 21st Amendment Brewery offers a variety of award winning house made brews and American grilled cuisine in a comfortable loft like setting. Join us before and after Giants baseball games in our outdoor beer garden. A great location for functions and parties in our semi-private Brewers Loft. See you soon at the 21A!\\\",\\\"address\\\":[\\\"563 Second Street\\\"],\\\"geo\\\":{\\\"accuracy\\\":\\\"ROOFTOP\\\",\\\"lat\\\":37.7825,\\\"lon\\\":-122.393}}\""}
      True
      

       

      Attachments

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

        Activity

          roi.katz Roi Katz created issue -
          jmorris Jeff Morris made changes -
          Field Original Value New Value
          Attachment screenshot-1.png [ 168055 ]
          jmorris Jeff Morris made changes -
          Attachment screenshot-2.png [ 168056 ]
          jmorris Jeff Morris added a comment -

          It looks like the server sends includes flexible framework extras in CB 7.0.2 but not in CB 6.6.1 (and others I imagine) and deserilize code in the Observe operation is incorrectly trying to fetch the key that was already read so the key length ends up huge and breaks:

          I'll push a patch as the packet header has already been read and it contains the key length, so I can just use it.

          jmorris Jeff Morris added a comment - It looks like the server sends includes flexible framework extras in CB 7.0.2 but not in CB 6.6.1 (and others I imagine) and deserilize code in the Observe operation is incorrectly trying to fetch the key that was already read so the key length ends up huge and breaks: I'll push a patch as the packet header has already been read and it contains the key length, so I can just use it.
          jmorris Jeff Morris made changes -
          Status New [ 10003 ] Open [ 1 ]
          jmorris Jeff Morris made changes -
          Fix Version/s 2.7.27 [ 17610 ]
          jmorris Jeff Morris made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          roi.katz Roi Katz added a comment -

          Jeff Morris  - Is that expected to be released tomorrow (7th of December?)

          roi.katz Roi Katz added a comment - Jeff Morris   - Is that expected to be released tomorrow (7th of December?)
          jmorris Jeff Morris added a comment -

          Roi Katz

          It will likely be not be tomorrow as priorities have changed. I'll take note to jump back onto when I can.

          Jeff

          jmorris Jeff Morris added a comment - Roi Katz It will likely be not be tomorrow as priorities have changed. I'll take note to jump back onto when I can. Jeff
          jmorris Jeff Morris made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]

          People

            jmorris Jeff Morris
            roi.katz Roi Katz
            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