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/”, line 48, in get_by_key
result = self.cb_coll_default.get(key)
File “/usr/local/lib/python3.10/site-packages/couchbase/”, line 161, in get
return self._get_internal(key, **final_args)
File “/usr/local/lib/python3.10/site-packages/couchbase/logic/”, line 111, in wrapped_fn
raise e
File “/usr/local/lib/python3.10/site-packages/couchbase/logic/”, 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/”, line 40, in decode_value
return transcoder.decode_value(value, flags)
File “/usr/local/lib/python3.10/site-packages/couchbase/”, line 121, in decode_value
raise ValueFormatException(

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.10/site-packages/flask/”, line 2077, in wsgi_app
response = self.full_dispatch_request()
File “/usr/local/lib/python3.10/site-packages/flask/”, line 1525, in full_dispatch_request
rv = self.handle_user_exception(e)
File “/usr/local/lib/python3.10/site-packages/flask/”, line 1523, in full_dispatch_request
rv = self.dispatch_request()
File “/usr/local/lib/python3.10/site-packages/flask/”, line 1509, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File “/usr/src/app/flaskr/”, line 28, in get_by_key
File “/usr/src/app/flaskr/”, line 55, in get_by_key
print (e)
File “/usr/local/lib/python3.10/site-packages/couchbase/”, line 333, in str
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?