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

Mutating Null Causes 'KV Error: EINVAL'

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.6
    • 2.1.7
    • library
    • None
    • Couchbase Server 6.0.3 in a Docker container
    • 1

    Description

      Similar to https://issues.couchbase.com/browse/NCBC-2640, but for Go SDK.

       

      When executing a mutation and trying to set `nil` as value, EINVAL is returned.

       

      Example code that I'm using:

      ```

      documentId := "hello1234"

      // First we insert some stuff, then we try to alter it
      _, errInsert := testDb.Collection.Insert(documentId, map[string]interface{}

      { "name": "hello", }

      , nil)
      require.NoError(t, errInsert)

      _, errMutate := testDb.Collection.MutateIn(documentId, []gocb.MutateInSpec

      { gocb.UpsertSpec("name", nil, &gocb.UpsertSpecOptions\{CreatePath: true}

      ),
      }, nil)

      // --> This throws the error <---
      require.NoError(t, errMutate)

      ```

       

      Returned error:

       

      invalid argument | {"status_code":4,"bucket":"bucket_test","scope":"_default","collection":"_default","error_name":"EINVAL","error_description":"Invalid packet","opaque":18,"last_dispatched_to":"192.168.1.109:11210","last_dispatched_from":"192.168.1.105:65378","last_connection_id":"2b9e1bcb4d45f655/7b20324a779687d1"}

      Attachments

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

        Activity

          No work has yet been logged on this issue.

          People

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