Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-1420

InternalSDKException when node fails

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 4.1.0
    • 4.0.4
    • None
    • None
    • 1

    Description

      Using the attached test program along with version 4.0.4 of the python SDK, when a cluster node goes down (e.g. network failure, power failure, etc.) without it being failed over, I'm experiencing an InternalSDKException.

      The test program loops forever reading a document, using get() . If an exception occurs, it tries to read the document with get_any_replica() . However, this fails with InternalSDKException which seems to be the result of poor checking of error conditions inside the SDK. 

       

      Reproduction steps:

      1. Edit the connection details in the test program (host, user, password, bucket)
      2. Start the test program
      3. Pull the plug on a node containing the test document (go by trial and error)
      4. When the code attempts to read with get_any_replica(), it fails throwing the InternalSDKException

       

      Here's an output showing the behavior:

      INFO:root:got res True
      INFO:root:got res True
      INFO:root:got res True
      INFO:root:got res True
      INFO:root:got res True
      INFO:root:got res True
      ERROR:root:got exception type <class 'couchbase.exceptions.UnAmbiguousTimeoutException'>: <ec=14, category=couchbase.common, message=unambiguous_timeout (14), context=KeyValueErrorContext:{'key': 'document', 'bucket_name': 'bucket', 'scope_name': '_default', 'collection_name': '_default', 'opaque': 0, 'status_code': 0}, C Source=/home/ec2-user/workspace/python/sdk/python-manylinux-wheel-pipeline/couchbase-python-client/src/kv_ops.cxx:156>
      Traceback (most recent call last):
        File "test2.py", line 22, in <module>
          res = col.get(KEY)
        File "/usr/lib/python3/dist-packages/couchbase/collection.py", line 169, in get
          return self._get_internal(key, **final_args)
        File "/usr/lib/python3/dist-packages/couchbase/logic/wrappers.py", line 138, in wrapped_fn
          raise e
        File "/usr/lib/python3/dist-packages/couchbase/logic/wrappers.py", line 119, in wrapped_fn
          raise ErrorMapper.build_exception(ret)
      couchbase.exceptions.UnAmbiguousTimeoutException: <ec=14, category=couchbase.common, message=unambiguous_timeout (14), context=KeyValueErrorContext:{'key': 'document', 'bucket_name': 'bucket', 'scope_name': '_default', 'collection_name': '_default', 'opaque': 0, 'status_code': 0}, C Source=/home/ec2-user/workspace/python/sdk/python-manylinux-wheel-pipeline/couchbase-python-client/src/kv_ops.cxx:156>
      ERROR:root:[replica] got exception type <class 'couchbase.exceptions.InternalSDKException'>: <message='utf-8' codec can't decode bytes in position 0-1: invalid continuation byte>
      Traceback (most recent call last):
        File "test2.py", line 22, in <module>
          res = col.get(KEY)
        File "/usr/lib/python3/dist-packages/couchbase/collection.py", line 169, in get
          return self._get_internal(key, **final_args)
        File "/usr/lib/python3/dist-packages/couchbase/logic/wrappers.py", line 138, in wrapped_fn
          raise e
        File "/usr/lib/python3/dist-packages/couchbase/logic/wrappers.py", line 119, in wrapped_fn
          raise ErrorMapper.build_exception(ret)
      couchbase.exceptions.UnAmbiguousTimeoutException: <ec=14, category=couchbase.common, message=unambiguous_timeout (14), context=KeyValueErrorContext:{'key': 'document', 'bucket_name': 'bucket', 'scope_name': '_default', 'collection_name': '_default', 'opaque': 0, 'status_code': 0}, C Source=/home/ec2-user/workspace/python/sdk/python-manylinux-wheel-pipeline/couchbase-python-client/src/kv_ops.cxx:156>
       
      During handling of the above exception, another exception occurred:
       
      Traceback (most recent call last):
        File "/usr/lib/python3/dist-packages/couchbase/logic/wrappers.py", line 129, in wrapped_fn
          ret.raw_result['value'] = decode_value(transcoder, value, flags, is_subdoc=is_suboc)
        File "/usr/lib/python3/dist-packages/couchbase/logic/wrappers.py", line 42, in decode_value
          return transcoder.decode_value(value, flags)
        File "/usr/lib/python3/dist-packages/couchbase/transcoder.py", line 127, in decode_value
          return self._serializer.deserialize(value)
        File "/usr/lib/python3/dist-packages/couchbase/serializer.py", line 49, in deserialize
          return json.loads(value.decode('utf-8'))
      UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 0-1: invalid continuation byte
       
      During handling of the above exception, another exception occurred:
       
      Traceback (most recent call last):
        File "test2.py", line 29, in <module>
          res = col.get_any_replica(KEY)
        File "/usr/lib/python3/dist-packages/couchbase/collection.py", line 235, in get_any_replica
          return self._get_any_replica_internal(key, **final_args)
        File "/usr/lib/python3/dist-packages/couchbase/logic/wrappers.py", line 142, in wrapped_fn
          raise excptn
      couchbase.exceptions.InternalSDKException: <message='utf-8' codec can't decode bytes in position 0-1: invalid continuation byte>
      ERROR:root:got exception type <class 'couchbase.exceptions.UnAmbiguousTimeoutException'>: <ec=14, category=couchbase.common, message=unambiguous_timeout (14), context=KeyValueErrorContext:{'key': 'document', 'bucket_name': 'bucket', 'scope_name': '_default', 'collection_name': '_default', 'opaque': 0, 'status_code': 0}, C Source=/home/ec2-user/workspace/python/sdk/python-manylinux-wheel-pipeline/couchbase-python-client/src/kv_ops.cxx:156>
      Traceback (most recent call last):
        File "test2.py", line 22, in <module>
          res = col.get(KEY)
        File "/usr/lib/python3/dist-packages/couchbase/collection.py", line 169, in get
          return self._get_internal(key, **final_args)
        File "/usr/lib/python3/dist-packages/couchbase/logic/wrappers.py", line 138, in wrapped_fn
          raise e
        File "/usr/lib/python3/dist-packages/couchbase/logic/wrappers.py", line 119, in wrapped_fn
          raise ErrorMapper.build_exception(ret)
       
       

       

      Attachments

        Issue Links

          For Gerrit Dashboard: PYCBC-1420
          # Subject Branch Project Status CR V

          Activity

            People

              jared.casey Jared Casey
              lcosmin Cos Min
              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