Details
-
Bug
-
Resolution: Fixed
-
Minor
-
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:
- Edit the connection details in the test program (host, user, password, bucket)
- Start the test program
- Pull the plug on a node containing the test document (go by trial and error)
- 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
- is caused by
-
CXXCBC-251 get_any_replica returns corrupted response
- Resolved
For Gerrit Dashboard: PYCBC-1420 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
182165,4 | PYCBC-1420: Prevent potential Exception for replica reads. | master | couchbase-python-client | Status: MERGED | +2 | +1 |