Couchbase python sdk 3 can not connect

Viewed 416

Looks like documentation does not update and async example does not work. https://github.com/couchbase/couchbase-python-client#asynchronous-tulip-api

I try to do this:

import asyncio

from acouchbase.cluster import Cluster
from couchbase.cluster import PasswordAuthenticator, ClusterOptions

async def write_and_read():
    passwd = PasswordAuthenticator(username='username', password='password')
    cluster = Cluster('couchbase://127.0.0.1', options=ClusterOptions(passwd))

    bucket = cluster.bucket('async_test')
    await bucket.upsert('test', dict())

loop = asyncio.get_event_loop()
rv = loop.run_until_complete(write_and_read())
print(rv)

But got error on line with upsert:

couchbase.exceptions.ClientTemporaryFailException: <RC=0x3F8[LCB_ERR_NO_CONFIGURATION 
(1016)], 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/store.c,250)>

Currently can not solve this problem and just migrate from 3 version to 2.5

OS: MacOS Catalina Python: 3.7 SDK: 3

0 Answers
Related