Getting error while fetching data using couchbase.collection.Collection.get

I am trying to fetch data from Couchbase bucket using couchbase.collection.Collection.get , but I am getting the bellow error :

[2022-07-07 15:16:54,102] ERROR in app: Exception on /GetByKey [POST]
Traceback (most recent call last):
File “/usr/src/app/flaskr/couch_operations.py”, line 48, in get_by_key
result = self.cb_coll_default.get(key)
File “/usr/local/lib/python3.10/site-packages/couchbase/collection.py”, line 161, in get
return self._get_internal(key, **final_args)
File “/usr/local/lib/python3.10/site-packages/couchbase/logic/wrappers.py”, line 111, in wrapped_fn
raise e
File “/usr/local/lib/python3.10/site-packages/couchbase/logic/wrappers.py”, line 102, in wrapped_fn
ret.raw_result[‘value’] = decode_value(transcoder, value, flags, is_subdoc=is_suboc)
File “/usr/local/lib/python3.10/site-packages/couchbase/logic/wrappers.py”, line 40, in decode_value
return transcoder.decode_value(value, flags)
File “/usr/local/lib/python3.10/site-packages/couchbase/transcoder.py”, line 121, in decode_value
raise ValueFormatException(
couchbase.exceptions.ValueFormatException:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.10/site-packages/flask/app.py”, line 2077, in wsgi_app
response = self.full_dispatch_request()
File “/usr/local/lib/python3.10/site-packages/flask/app.py”, line 1525, in full_dispatch_request
rv = self.handle_user_exception(e)
File “/usr/local/lib/python3.10/site-packages/flask/app.py”, line 1523, in full_dispatch_request
rv = self.dispatch_request()
File “/usr/local/lib/python3.10/site-packages/flask/app.py”, line 1509, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File “/usr/src/app/flaskr/init.py”, line 28, in get_by_key
result=object.get_by_key(Key)
File “/usr/src/app/flaskr/couch_operations.py”, line 55, in get_by_key
print (e)
File “/usr/local/lib/python3.10/site-packages/couchbase/exceptions.py”, line 333, in str
self._base.err(),
AttributeError: ‘str’ object has no attribute ‘err’

Please help.

Hi @niri1998,

Could you share some details so we can try to debug the issue better?

Which version of the Couchbase SDK are you using?

Also, could you share the code snippet where you see the error?