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

Mutating Null Causes 'KV Error: EINVAL'

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 3.0.5
    • None
    • None
    • 1
    • Medium

    Description

      Use case
      The document stored user profile information with an email field. The user clears his email and saves his profile.

      Steps to reproduce

      1. Create a new document

        {
            "name": "User1",
            "email": "email"
        }
        

      1. Mutate the document using the .NET client 3.0.5.

        class Program
        {
            private static ICluster _cluster;
         
            static async Task Main(string[] args)
            {
                var userInfo = new
                {
                    Name = "User1",
                    Email = (string)null
                };
         
                _cluster = await Cluster.ConnectAsync("couchbase://localhost", "Administrator", "Password");
         
                var bucket = await _cluster.BucketAsync("items");
                await bucket.DefaultCollection().MutateInAsync("doc1", new[]
                {
                    MutateInSpec.Upsert("name", userInfo.Name),
                    MutateInSpec.Upsert("email", userInfo.Email)
                });
         
                _cluster.Dispose();
            }
        }
        

      #The following exception is show:

      Couchbase.Core.Exceptions.InvalidArgumentException
      {"DispatchedFrom":null,"DispatchedTo":null,"DocumentKey":"doc1","ClientContextId":"19","Cas":0,"Status":4,"BucketName":"items","CollectionName":"_default","ScopeName":null,"Message":"KV Error: {Name=\"EINVAL\", Description=\"Invalid packet\", Attributes=\"internal,invalid-input\"}"}
      

      Attachments

        1. ConsoleApp1.zip
          2 kB
        2. console-example.log
          9 kB
        3. console-example.log
          9 kB
        4. console-example.log
          9 kB
        5. console-example.log
          9 kB
        6. console-example-internal.log
          1 kB
        7. console-example-internal.log
          1 kB
        8. console-example-internal.log
          1 kB
        9. console-example-internal.log
          1 kB

        Issue Links

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

          Activity

            People

              jmorris Jeff Morris
              narhangelov Nikolay Arhangelov
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty