Using the code below, it is possible to download a full document in a bucket, but issuing a query to that same cluster fails with an exception. I am having difficulty figuring out where to look to fix the issue. I’m using python 3.9.5 with the 3.1.1 python SDK and couchbase-ce 6.6.0
What I have is the narrowed representation of the problem. Anyone have any ideas on what to look for? Couchbase is running inside of a docker container and it is using a docker bridge network to communicate to another container which is executing this code. Could that network layering be a problem somehow (not sure why it would only fail for cluster queries, though)
First here is the exception on query:
couchbase.exceptions.InvalidArgumentException: <RC=0xCB[LCB_ERR_INVALID_ARGUMENT (203)], There was a problem scheduling your request, or determining the appropriate server or vBucket for the key(s) requested. This may also ba bug in the SDK if there are no network issues, C Source=(src/pycbc_http.c,388)>
Full Exception
>>> cluster.query('select 1')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/couchbase/cluster.py", line 557, in query
return self._maybe_operate_on_an_open_bucket(CoreClient.query,
File "/usr/local/lib/python3.9/site-packages/couchbase/cluster.py", line 576, in _maybe_operate_on_an_open_bucket
if self._is_6_5_plus():
File "/usr/local/lib/python3.9/site-packages/couchbase/cluster.py", line 507, in _is_6_5_plus
response = self._admin.http_request(path="/pools").value
File "/usr/local/lib/python3.9/site-packages/couchbase/management/admin.py", line 182, in http_request
return self._http_request(type=LCB.LCB_HTTP_TYPE_MANAGEMENT,
couchbase.exceptions.InvalidArgumentException: <RC=0xCB[LCB_ERR_INVALID_ARGUMENT (203)], There was a problem scheduling your request, or determining the appropriate server or vBucket for the key(s) requested. This may also be a bug in the SDK if there are no network issues, C Source=(src/pycbc_http.c,388)>
The code:
from couchbase.cluster import Cluster, ClusterOptions, QueryOptions, QueryScanConsistency
from couchbase_core.cluster import PasswordAuthenticator
cluster = Cluster.connect("couchbase://couchbase.my.domain", ClusterOptions(PasswordAuthenticator("Administrator", "password")))
bucket = cluster.bucket("resource")
collection = bucket.default_collection()
collection.get('testdoc') # works
bucket.get('testdoc') # works
bucket.query('SELECT 1') # works
cluster.query('SELECT 1') # fails