Description
Not sure if this is a Python on a Couchbase-CXX issue, please move if it is.
Problem
If there is a typo in the schema no error is produce and instead a timeout is produce.
Expectation
For a better error message to be produce
Steps to reproduce
Run the following script, noticed that the schema is incorrect: paddy://
# needed for any cluster connection
|
from couchbase.cluster import Cluster
|
from couchbase.auth import PasswordAuthenticator
|
from couchbase.options import (ClusterOptions, ClusterTimeoutOptions,
|
QueryOptions)
|
|
# needed to support SQL++ (N1QL) query
|
from couchbase.cluster import QueryOptions
|
|
# get a reference to our cluster
|
cluster = Cluster('paddy://localhost', ClusterOptions(
|
PasswordAuthenticator('Administrator', 'password')))
|
|
# get a reference to our bucket
|
cb = cluster.bucket('travel-sample')
|
|
cb_coll_default = cb.default_collection()
|
result = cb_coll_default.get('airline_10')
|
print(result.content_as[str])
|
It will fail with a timeout
Traceback (most recent call last):
|
File "test-cb.py", line 11, in <module>
|
cluster = Cluster('paddy://localhost', ClusterOptions(
|
File "/usr/local/lib/python3.8/site-packages/couchbase/cluster.py", line 99, in __init__
|
self._connect()
|
File "/usr/local/lib/python3.8/site-packages/couchbase/logic/wrappers.py", line 79, in wrapped_fn
|
raise e
|
File "/usr/local/lib/python3.8/site-packages/couchbase/logic/wrappers.py", line 63, in wrapped_fn
|
ret = fn(self, *args, **kwargs)
|
File "/usr/local/lib/python3.8/site-packages/couchbase/cluster.py", line 105, in _connect
|
raise ErrorMapper.build_exception(ret)
|
couchbase.exceptions.UnAmbiguousTimeoutException: <ec=14, category=couchbase.common, message=unambiguous_timeout, C Source=/tmp/pip-install-m32c_u4h/couchbase_1a8227f1df6f4bd284fe14ab216a1be6/src/connection.cxx:149>
|