Bucket.default_collection() causing TypeError

Hi,
I’m getting this error whenever trying to run the server. Can someone explain to me what is causing this issue? How can I fix this?

File "/home/ubuntu/folder_name/venv_bknd/lib/python3.8/site-packages/starlette/routing.py", line 517, in lifespan await self.startup() File "/home/ubuntu/folder_name/venv_bknd/lib/python3.8/site-packages/starlette/routing.py", line 494, in startup await handler() File "./app/main.py", line 108, in startup await get_customers_client() File "./app/__init__.py", line 34, in get_customers_client customers = customers.default_collection() File "/home/ubuntu/folder_name/venv_bknd/lib/python3.8/site-packages/couchbase/bucket.py", line 238, in default_collection return Scope(self).default_collection() File "/home/ubuntu/folder_name/venv_bknd/lib/python3.8/site-packages/couchbase/collection.py", line 1588, in default_collection return self._gen_collection(None) File "/home/ubuntu/folder_name/venv_bknd/lib/python3.8/site-packages/couchbase/collection.py", line 1594, in _gen_collection return CBCollection._cast(self, collection_name) File "/home/ubuntu/folder_name/venv_bknd/lib/python3.8/site-packages/couchbase/collection.py", line 431, in _cast result = parent_scope.bucket._collection_factory(connection_string=parent_scope.bucket._connstr, **coll_args) File "/home/ubuntu/folder_name/venv_bknd/lib/python3.8/site-packages/acouchbase/cluster.py", line 28, in __new__ return super(AIOClientMixin, cls).__new__(cls, *args, **kwargs) TypeError: object.__new__() takes exactly one argument (the type to instantiate)

Hi, this looks not dissimilar to another issue we fixed recently - the function called by super(xxx, cls).__new__(cls, *args, **kwargs) may be a type constructor instead of a class constructor.
That seems only to happen on some Python distributions.

Does this happen on the very latest couchbase version (3.0.3)? Does it happen on specific Python versions? Which version/distro of Python are you using?

I’ve raised a bug to use another method of initialising the class if necessary/possible - https://issues.couchbase.com/browse/PYCBC-993

Thanks,

Ellis

Thanks for replying :slightly_smiling_face:, I’m using 3.0.1. on my local it’s working but I’m now trying to setup this on server.

OK, it may have been fixed in 3.0.2 - please try 3.0.3. Thanks, Ellis

I’m getting the same error in couchbase==3.0.3. Is their any workaround for this?