Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-1077

Async Cluster object cannot be reused after failed connection

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.6
    • 3.2.3
    • library
    • None
    • 1

    Description

      After creating a Cluster, and (using asyncio), we await the cluster.on_connect(), if we get an exception, the Cluster object can't be reused (say, just calling await cluster.on_connect() again).

      The reason is, the underlying C bindings sets connected to True after that failed connection, and doesn't try to connect again, instead returning None.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          david.kelly David Kelly added a comment -

          For example:

          Using this script:

          import sys
          import couchbase
          from couchbase.auth import PasswordAuthenticator
          from acouchbase.cluster import Cluster
          from couchbase.exceptions import CouchbaseException
           
          couchbase.enable_logging()
           
          logging.basicConfig(level=logging.DEBUG)
          logger = logging.getLogger()
           
           
          async def main():
              conn_str = 'couchbase://127.0.0.2'
              auth = PasswordAuthenticator('Administrator', 'password')
           
              client = Cluster(conn_str, authenticator=auth)
              logger.info('client before on_connect - connected: %s', client.connected)
           
           
              try:
                  await client.on_connect()
                  logger.info('client connected after await: %s', client.connected)
              except CouchbaseException as e:
                  logger.exception('Connection failed with %s, client.connected %s', e, client.connected)
           
              try:
                  await client.on_connect()
                  logger.info("client await second time success, client.connected %s", client.connected)
              except CouchbaseException as e:
                  logger.exception("on_connect failed a second time %s, client.connected %s", e, client.connected)
           
           
          asyncio.get_event_loop().run_until_complete(main())
          

          When I point to a non-existent IP address I see:

          DEBUG:asyncio:Using selector: KqueueSelector
          INFO:couchbase.bootstrap:[6371630986059980775] Requested network configuration: heuristic (L:265)
          DEBUG:couchbase.confmon:[6371630986059980775] Preparing providers (this may be called multiple times) (L:92)
          DEBUG:couchbase.confmon:[6371630986059980775] Provider CCCP is ENABLED (L:99)
          DEBUG:couchbase.confmon:[6371630986059980775] Provider HTTP is ENABLED (L:99)
          DEBUG:couchbase.confmon:[6371630986059980775] Refreshing current cluster map (bucket: (null)) (L:298)
          INFO:couchbase.cccp:[6371630986059980775] Requesting connection to node 127.0.0.2:11210 for CCCP configuration (L:160)
          DEBUG:couchbase.lcbio_mgr:[6371630986059980775] <127.0.0.2:11210> (HE=0x7fa981e04300) Creating new connection because none are available in the pool (L:494)
          DEBUG:couchbase.lcbio_mgr:[6371630986059980775] <127.0.0.2:11210> (HE=0x7fa981e04300) New pool entry: I=0x7fa981e04470 (L:406)
          INFO:couchbase.connection:[6371630986059980775] <127.0.0.2:11210> (SOCK=90e2594eaab68988) Starting. Timeout=2000000us (L:487)
          DEBUG:couchbase.connection:[6371630986059980775] <127.0.0.2:11210> (SOCK=90e2594eaab68988) Created new socket with FD=6 (L:252)
          DEBUG:couchbase.connection:[6371630986059980775] <127.0.0.2:11210> (SOCK=90e2594eaab68988) Scheduling I/O watcher for asynchronous connection completion. (L:352)
          INFO:root:client before on_connect - connected: False
          DEBUG:couchbase.confmon:[6371630986059980775] Attempting to retrieve cluster map via CCCP (L:284)
          ERROR:couchbase.cccp:[6371630986059980775] <NOHOST:NOPORT> (CTX=0x0,) Could not get configuration: LCB_ERR_TIMEOUT (201) (L:171)
          INFO:couchbase.confmon:[6371630986059980775] Provider 'CCCP' failed: LCB_ERR_TIMEOUT (201) (L:195)
          DEBUG:couchbase.confmon:[6371630986059980775] Will try next provider in 0us (L:239)
          ERROR:couchbase.connection:[6371630986059980775] <127.0.0.2:11210> (SOCK=90e2594eaab68988) Failed to establish connection: LCB_ERR_TIMEOUT (201), os errno=0 (L:164)
          DEBUG:couchbase.lcbio_mgr:[6371630986059980775] <127.0.0.2:11210> (HE=0x7fa981e04300) Received result for I=0x7fa981e04470,C=0x0; E=0xc9 (L:362)
          DEBUG:couchbase.confmon:[6371630986059980775] Attempting to retrieve cluster map via HTTP (L:284)
          DEBUG:couchbase.htconfig:[6371630986059980775] Starting HTTP Configuration Provider 0x7fa991c62430 (L:359)
          INFO:couchbase.connection:[6371630986059980775] <127.0.0.2:8091> (SOCK=f8c70b51a1ad0de2) Starting. Timeout=2000000us (L:487)
          DEBUG:couchbase.connection:[6371630986059980775] <127.0.0.2:8091> (SOCK=f8c70b51a1ad0de2) Created new socket with FD=6 (L:252)
          DEBUG:couchbase.connection:[6371630986059980775] <127.0.0.2:8091> (SOCK=f8c70b51a1ad0de2) Scheduling I/O watcher for asynchronous connection completion. (L:352)
          ERROR:couchbase.connection:[6371630986059980775] <127.0.0.2:8091> (SOCK=f8c70b51a1ad0de2) Failed to establish connection: LCB_ERR_TIMEOUT (201), os errno=0 (L:164)
          ERROR:couchbase.htconfig:[6371630986059980775] Connection to REST API failed with LCB_ERR_TIMEOUT (201) (os errno = 0) (L:309)
          INFO:couchbase.confmon:[6371630986059980775] Provider 'HTTP' failed: LCB_ERR_TIMEOUT (201) (L:195)
          DEBUG:couchbase.confmon:[6371630986059980775] Maximum provider reached. Resetting index (L:244)
          ERROR:couchbase.bootstrap:[6371630986059980775] Failed to bootstrap client=0x7fa991c78680. Error=LCB_ERR_NO_MATCHING_SERVER (1010) (Last=LCB_ERR_TIMEOUT (201)), Message=No more bootstrap providers remain (L:195)
          ERROR:root:Connection failed with <RC=0x3F2[LCB_ERR_NO_MATCHING_SERVER (1010)], Error getting initial connection to cluster>, client.connected True
          Traceback (most recent call last):
            File "/Users/davidkelly/projects/gerrit/couchbase-python-client/simple_async.py", line 24, in main
              await client.on_connect()
          couchbase.exceptions.DocumentUnretrievableException: <RC=0x3F2[LCB_ERR_NO_MATCHING_SERVER (1010)], Error getting initial connection to cluster>
          Traceback (most recent call last):
            File "/Users/davidkelly/projects/gerrit/couchbase-python-client/simple_async.py", line 36, in <module>
              asyncio.get_event_loop().run_until_complete(main())
            File "/usr/local/Cellar/python@3.9/3.9.0_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
              return future.result()
            File "/Users/davidkelly/projects/gerrit/couchbase-python-client/simple_async.py", line 30, in main
              await client.on_connect()
          TypeError: object NoneType can't be used in 'await' expression
          

          When I point it to an existing cluster, I see:

          DEBUG:asyncio:Using selector: KqueueSelector
          INFO:couchbase.bootstrap:[-999204302200575653] Requested network configuration: heuristic (L:265)
          DEBUG:couchbase.confmon:[-999204302200575653] Preparing providers (this may be called multiple times) (L:92)
          DEBUG:couchbase.confmon:[-999204302200575653] Provider CCCP is ENABLED (L:99)
          DEBUG:couchbase.confmon:[-999204302200575653] Provider HTTP is ENABLED (L:99)
          DEBUG:couchbase.confmon:[-999204302200575653] Refreshing current cluster map (bucket: (null)) (L:298)
          INFO:couchbase.cccp:[-999204302200575653] Requesting connection to node 127.0.0.1:11210 for CCCP configuration (L:160)
          DEBUG:couchbase.lcbio_mgr:[-999204302200575653] <127.0.0.1:11210> (HE=0x7fbe12e89860) Creating new connection because none are available in the pool (L:494)
          DEBUG:couchbase.lcbio_mgr:[-999204302200575653] <127.0.0.1:11210> (HE=0x7fbe12e89860) New pool entry: I=0x7fbe12e88340 (L:406)
          INFO:couchbase.connection:[-999204302200575653] <127.0.0.1:11210> (SOCK=af9ae57b991f7350) Starting. Timeout=2000000us (L:487)
          DEBUG:couchbase.connection:[-999204302200575653] <127.0.0.1:11210> (SOCK=af9ae57b991f7350) Created new socket with FD=6 (L:252)
          DEBUG:couchbase.connection:[-999204302200575653] <127.0.0.1:11210> (SOCK=af9ae57b991f7350) Scheduling I/O watcher for asynchronous connection completion. (L:352)
          INFO:root:client before on_connect - connected: False
          DEBUG:couchbase.confmon:[-999204302200575653] Attempting to retrieve cluster map via CCCP (L:284)
          INFO:couchbase.connection:[-999204302200575653] <127.0.0.1:11210> (SOCK=af9ae57b991f7350) Connected established (L:155)
          DEBUG:couchbase.connection:[-999204302200575653] <127.0.0.1:11210> (SOCK=af9ae57b991f7350) Successfully set TCP_NODELAY (L:108)
          DEBUG:couchbase.connection:[-999204302200575653] <127.0.0.1:11210> (SOCK=af9ae57b991f7350) Successfully set TCP_KEEPALIVE (L:108)
          DEBUG:couchbase.lcbio_mgr:[-999204302200575653] <127.0.0.1:11210> (HE=0x7fbe12e89860) Received result for I=0x7fbe12e88340,C=0x0; E=0x0 (L:362)
          DEBUG:couchbase.lcbio_mgr:[-999204302200575653] <127.0.0.1:11210> (HE=0x7fbe12e89860) Assigning R=0x7fbe12e660b0 SOCKET=0x7fbe12e82300 (L:322)
          DEBUG:couchbase.ioctx:[-999204302200575653] <127.0.0.1:11210> (CTX=0x7fbe12c36040,unknown) Pairing with SOCK=af9ae57b991f7350 (L:95)
          DEBUG:couchbase.negotiation:[-999204302200575653] <127.0.0.1:11210> (CTX=0x7fbe12c36040,sasl,SASLREQ=0x7fbe12c36990) HELO identificator: {"a":"libcouchbase/3.0.6_2_ga1e9e1ca91 (Darwin-19.6.0; x86_64; Clang 11.0.0.11000033) PYCBC/3.0.6.dev2+ga1e9e1ca","i":"f2221cfb2d4ae95b/af9ae57b991f7350"}, features: 0x02 (TLS), 0x06 (XATTR), 0x0b (JSON), 0x08 (Select bucket), 0x07 (XERROR), 0x03 (TCP nodelay), 0x0a (Snappy), 0x04 (Mutation seqno), 0x0f (Tracing), 0x12 (Collections), 0x0e (Unordered execution), 0x17 (Create as Deleted) (L:455)
          DEBUG:couchbase.negotiation:[-999204302200575653] <127.0.0.1:11210> (CTX=0x7fbe12c36040,sasl,SASLREQ=0x7fbe12c36990) Server supports features: 0x03 (TCP nodelay), 0x04 (Mutation seqno), 0x06 (XATTR), 0x07 (XERROR), 0x08 (Select bucket), 0x0a (Snappy), 0x0b (JSON), 0x0e (Unordered execution), 0x0f (Tracing), 0x17 (Create as Deleted) (L:486)
          DEBUG:couchbase.ioctx:[-999204302200575653] <127.0.0.1:11210> (CTX=0x7fbe12c36040,sasl) Destroying context. Pending Writes=0, Entered=true, Socket Refcount=1 (L:140)
          DEBUG:couchbase.ioctx:[-999204302200575653] <127.0.0.1:11210> (CTX=0x7fbe12d5a000,unknown) Pairing with SOCK=af9ae57b991f7350 (L:95)
          DEBUG:couchbase.ioctx:[-999204302200575653] <127.0.0.1:11210> (CTX=0x7fbe12d5a000,bc_cccp) Destroying context. Pending Writes=0, Entered=true, Socket Refcount=1 (L:140)
          DEBUG:couchbase.lcbio_mgr:[-999204302200575653] <127.0.0.1:11210> (HE=0x7fbe12e89860) Placing socket back into the pool. I=0x7fbe12e88340,C=0x7fbe12e82300 (L:549)
          INFO:couchbase.confmon:[-999204302200575653] Setting new configuration. Received via CCCP (L:168)
          DEBUG:couchbase.confmon:[-999204302200575653] Preparing providers (this may be called multiple times) (L:92)
          DEBUG:couchbase.confmon:[-999204302200575653] Provider CCCP is ENABLED (L:99)
          INFO:couchbase.bootstrap:[-999204302200575653] Selected network configuration: "default" (L:91)
          INFO:root:client connected after await: True
          Traceback (most recent call last):
            File "/Users/davidkelly/projects/gerrit/couchbase-python-client/src/../simple_async.py", line 36, in <module>
              asyncio.get_event_loop().run_until_complete(main())
            File "/usr/local/Cellar/python@3.9/3.9.0_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
              return future.result()
            File "/Users/davidkelly/projects/gerrit/couchbase-python-client/src/../simple_async.py", line 30, in main
              await client.on_connect()
          TypeError: object NoneType can't be used in 'await' expression

          So - a few things:

          • we should be able to retry the on_connect I believe, when we get a failure
          • when we wait again for on_connect after a success, we should not get an exception
          • we translate 1010 from lcb into the wrong exception - probably need some context to get that right - as this may be correct when doing get_replica or similar.
            • So couchbase.exceptions.DocumentUnretrievableException: <RC=0x3F2[LCB_ERR_NO_MATCHING_SERVER (1010)], Error getting initial connection to cluster>
              should be a couchbase.exceptions.ConnectionException perhaps?
          david.kelly David Kelly added a comment - For example: Using this script: import sys import couchbase from couchbase.auth import PasswordAuthenticator from acouchbase.cluster import Cluster from couchbase.exceptions import CouchbaseException   couchbase.enable_logging()   logging.basicConfig(level = logging.DEBUG) logger = logging.getLogger()     async def main(): conn_str = 'couchbase://127.0.0.2' auth = PasswordAuthenticator( 'Administrator' , 'password' )   client = Cluster(conn_str, authenticator = auth) logger.info( 'client before on_connect - connected: %s' , client.connected)     try : await client.on_connect() logger.info( 'client connected after await: %s' , client.connected) except CouchbaseException as e: logger.exception( 'Connection failed with %s, client.connected %s' , e, client.connected)   try : await client.on_connect() logger.info( "client await second time success, client.connected %s" , client.connected) except CouchbaseException as e: logger.exception( "on_connect failed a second time %s, client.connected %s" , e, client.connected)     asyncio.get_event_loop().run_until_complete(main()) When I point to a non-existent IP address I see: DEBUG:asyncio:Using selector: KqueueSelector INFO:couchbase.bootstrap:[6371630986059980775] Requested network configuration: heuristic (L:265) DEBUG:couchbase.confmon:[6371630986059980775] Preparing providers (this may be called multiple times) (L:92) DEBUG:couchbase.confmon:[6371630986059980775] Provider CCCP is ENABLED (L:99) DEBUG:couchbase.confmon:[6371630986059980775] Provider HTTP is ENABLED (L:99) DEBUG:couchbase.confmon:[6371630986059980775] Refreshing current cluster map (bucket: (null)) (L:298) INFO:couchbase.cccp:[6371630986059980775] Requesting connection to node 127.0.0.2:11210 for CCCP configuration (L:160) DEBUG:couchbase.lcbio_mgr:[6371630986059980775] <127.0.0.2:11210> (HE=0x7fa981e04300) Creating new connection because none are available in the pool (L:494) DEBUG:couchbase.lcbio_mgr:[6371630986059980775] <127.0.0.2:11210> (HE=0x7fa981e04300) New pool entry: I=0x7fa981e04470 (L:406) INFO:couchbase.connection:[6371630986059980775] <127.0.0.2:11210> (SOCK=90e2594eaab68988) Starting. Timeout=2000000us (L:487) DEBUG:couchbase.connection:[6371630986059980775] <127.0.0.2:11210> (SOCK=90e2594eaab68988) Created new socket with FD=6 (L:252) DEBUG:couchbase.connection:[6371630986059980775] <127.0.0.2:11210> (SOCK=90e2594eaab68988) Scheduling I/O watcher for asynchronous connection completion. (L:352) INFO:root:client before on_connect - connected: False DEBUG:couchbase.confmon:[6371630986059980775] Attempting to retrieve cluster map via CCCP (L:284) ERROR:couchbase.cccp:[6371630986059980775] <NOHOST:NOPORT> (CTX=0x0,) Could not get configuration: LCB_ERR_TIMEOUT (201) (L:171) INFO:couchbase.confmon:[6371630986059980775] Provider 'CCCP' failed: LCB_ERR_TIMEOUT (201) (L:195) DEBUG:couchbase.confmon:[6371630986059980775] Will try next provider in 0us (L:239) ERROR:couchbase.connection:[6371630986059980775] <127.0.0.2:11210> (SOCK=90e2594eaab68988) Failed to establish connection: LCB_ERR_TIMEOUT (201), os errno=0 (L:164) DEBUG:couchbase.lcbio_mgr:[6371630986059980775] <127.0.0.2:11210> (HE=0x7fa981e04300) Received result for I=0x7fa981e04470,C=0x0; E=0xc9 (L:362) DEBUG:couchbase.confmon:[6371630986059980775] Attempting to retrieve cluster map via HTTP (L:284) DEBUG:couchbase.htconfig:[6371630986059980775] Starting HTTP Configuration Provider 0x7fa991c62430 (L:359) INFO:couchbase.connection:[6371630986059980775] <127.0.0.2:8091> (SOCK=f8c70b51a1ad0de2) Starting. Timeout=2000000us (L:487) DEBUG:couchbase.connection:[6371630986059980775] <127.0.0.2:8091> (SOCK=f8c70b51a1ad0de2) Created new socket with FD=6 (L:252) DEBUG:couchbase.connection:[6371630986059980775] <127.0.0.2:8091> (SOCK=f8c70b51a1ad0de2) Scheduling I/O watcher for asynchronous connection completion. (L:352) ERROR:couchbase.connection:[6371630986059980775] <127.0.0.2:8091> (SOCK=f8c70b51a1ad0de2) Failed to establish connection: LCB_ERR_TIMEOUT (201), os errno=0 (L:164) ERROR:couchbase.htconfig:[6371630986059980775] Connection to REST API failed with LCB_ERR_TIMEOUT (201) (os errno = 0) (L:309) INFO:couchbase.confmon:[6371630986059980775] Provider 'HTTP' failed: LCB_ERR_TIMEOUT (201) (L:195) DEBUG:couchbase.confmon:[6371630986059980775] Maximum provider reached. Resetting index (L:244) ERROR:couchbase.bootstrap:[6371630986059980775] Failed to bootstrap client=0x7fa991c78680. Error=LCB_ERR_NO_MATCHING_SERVER (1010) (Last=LCB_ERR_TIMEOUT (201)), Message=No more bootstrap providers remain (L:195) ERROR:root:Connection failed with <RC=0x3F2[LCB_ERR_NO_MATCHING_SERVER (1010)], Error getting initial connection to cluster>, client.connected True Traceback (most recent call last): File "/Users/davidkelly/projects/gerrit/couchbase-python-client/simple_async.py", line 24, in main await client.on_connect() couchbase.exceptions.DocumentUnretrievableException: <RC=0x3F2[LCB_ERR_NO_MATCHING_SERVER (1010)], Error getting initial connection to cluster> Traceback (most recent call last): File "/Users/davidkelly/projects/gerrit/couchbase-python-client/simple_async.py", line 36, in <module> asyncio.get_event_loop().run_until_complete(main()) File "/usr/local/Cellar/python@3.9/3.9.0_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/Users/davidkelly/projects/gerrit/couchbase-python-client/simple_async.py", line 30, in main await client.on_connect() TypeError: object NoneType can't be used in 'await' expression When I point it to an existing cluster, I see: DEBUG:asyncio:Using selector: KqueueSelector INFO:couchbase.bootstrap:[-999204302200575653] Requested network configuration: heuristic (L:265) DEBUG:couchbase.confmon:[-999204302200575653] Preparing providers (this may be called multiple times) (L:92) DEBUG:couchbase.confmon:[-999204302200575653] Provider CCCP is ENABLED (L:99) DEBUG:couchbase.confmon:[-999204302200575653] Provider HTTP is ENABLED (L:99) DEBUG:couchbase.confmon:[-999204302200575653] Refreshing current cluster map (bucket: (null)) (L:298) INFO:couchbase.cccp:[-999204302200575653] Requesting connection to node 127.0.0.1:11210 for CCCP configuration (L:160) DEBUG:couchbase.lcbio_mgr:[-999204302200575653] <127.0.0.1:11210> (HE=0x7fbe12e89860) Creating new connection because none are available in the pool (L:494) DEBUG:couchbase.lcbio_mgr:[-999204302200575653] <127.0.0.1:11210> (HE=0x7fbe12e89860) New pool entry: I=0x7fbe12e88340 (L:406) INFO:couchbase.connection:[-999204302200575653] <127.0.0.1:11210> (SOCK=af9ae57b991f7350) Starting. Timeout=2000000us (L:487) DEBUG:couchbase.connection:[-999204302200575653] <127.0.0.1:11210> (SOCK=af9ae57b991f7350) Created new socket with FD=6 (L:252) DEBUG:couchbase.connection:[-999204302200575653] <127.0.0.1:11210> (SOCK=af9ae57b991f7350) Scheduling I/O watcher for asynchronous connection completion. (L:352) INFO:root:client before on_connect - connected: False DEBUG:couchbase.confmon:[-999204302200575653] Attempting to retrieve cluster map via CCCP (L:284) INFO:couchbase.connection:[-999204302200575653] <127.0.0.1:11210> (SOCK=af9ae57b991f7350) Connected established (L:155) DEBUG:couchbase.connection:[-999204302200575653] <127.0.0.1:11210> (SOCK=af9ae57b991f7350) Successfully set TCP_NODELAY (L:108) DEBUG:couchbase.connection:[-999204302200575653] <127.0.0.1:11210> (SOCK=af9ae57b991f7350) Successfully set TCP_KEEPALIVE (L:108) DEBUG:couchbase.lcbio_mgr:[-999204302200575653] <127.0.0.1:11210> (HE=0x7fbe12e89860) Received result for I=0x7fbe12e88340,C=0x0; E=0x0 (L:362) DEBUG:couchbase.lcbio_mgr:[-999204302200575653] <127.0.0.1:11210> (HE=0x7fbe12e89860) Assigning R=0x7fbe12e660b0 SOCKET=0x7fbe12e82300 (L:322) DEBUG:couchbase.ioctx:[-999204302200575653] <127.0.0.1:11210> (CTX=0x7fbe12c36040,unknown) Pairing with SOCK=af9ae57b991f7350 (L:95) DEBUG:couchbase.negotiation:[-999204302200575653] <127.0.0.1:11210> (CTX=0x7fbe12c36040,sasl,SASLREQ=0x7fbe12c36990) HELO identificator: {"a":"libcouchbase/3.0.6_2_ga1e9e1ca91 (Darwin-19.6.0; x86_64; Clang 11.0.0.11000033) PYCBC/3.0.6.dev2+ga1e9e1ca","i":"f2221cfb2d4ae95b/af9ae57b991f7350"}, features: 0x02 (TLS), 0x06 (XATTR), 0x0b (JSON), 0x08 (Select bucket), 0x07 (XERROR), 0x03 (TCP nodelay), 0x0a (Snappy), 0x04 (Mutation seqno), 0x0f (Tracing), 0x12 (Collections), 0x0e (Unordered execution), 0x17 (Create as Deleted) (L:455) DEBUG:couchbase.negotiation:[-999204302200575653] <127.0.0.1:11210> (CTX=0x7fbe12c36040,sasl,SASLREQ=0x7fbe12c36990) Server supports features: 0x03 (TCP nodelay), 0x04 (Mutation seqno), 0x06 (XATTR), 0x07 (XERROR), 0x08 (Select bucket), 0x0a (Snappy), 0x0b (JSON), 0x0e (Unordered execution), 0x0f (Tracing), 0x17 (Create as Deleted) (L:486) DEBUG:couchbase.ioctx:[-999204302200575653] <127.0.0.1:11210> (CTX=0x7fbe12c36040,sasl) Destroying context. Pending Writes=0, Entered=true, Socket Refcount=1 (L:140) DEBUG:couchbase.ioctx:[-999204302200575653] <127.0.0.1:11210> (CTX=0x7fbe12d5a000,unknown) Pairing with SOCK=af9ae57b991f7350 (L:95) DEBUG:couchbase.ioctx:[-999204302200575653] <127.0.0.1:11210> (CTX=0x7fbe12d5a000,bc_cccp) Destroying context. Pending Writes=0, Entered=true, Socket Refcount=1 (L:140) DEBUG:couchbase.lcbio_mgr:[-999204302200575653] <127.0.0.1:11210> (HE=0x7fbe12e89860) Placing socket back into the pool. I=0x7fbe12e88340,C=0x7fbe12e82300 (L:549) INFO:couchbase.confmon:[-999204302200575653] Setting new configuration. Received via CCCP (L:168) DEBUG:couchbase.confmon:[-999204302200575653] Preparing providers (this may be called multiple times) (L:92) DEBUG:couchbase.confmon:[-999204302200575653] Provider CCCP is ENABLED (L:99) INFO:couchbase.bootstrap:[-999204302200575653] Selected network configuration: "default" (L:91) INFO:root:client connected after await: True Traceback (most recent call last): File "/Users/davidkelly/projects/gerrit/couchbase-python-client/src/../simple_async.py", line 36, in <module> asyncio.get_event_loop().run_until_complete(main()) File "/usr/local/Cellar/python@3.9/3.9.0_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/Users/davidkelly/projects/gerrit/couchbase-python-client/src/../simple_async.py", line 30, in main await client.on_connect() TypeError: object NoneType can't be used in 'await' expression So - a few things: we should be able to retry the on_connect I believe, when we get a failure when we wait again for on_connect after a success, we should not get an exception we translate 1010 from lcb into the wrong exception - probably need some context to get that right - as this may be correct when doing get_replica or similar. So couchbase.exceptions.DocumentUnretrievableException: <RC=0x3F2 [LCB_ERR_NO_MATCHING_SERVER (1010)] , Error getting initial connection to cluster> should be a couchbase.exceptions.ConnectionException perhaps?

          People

            jared.casey Jared Casey
            david.kelly David Kelly
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty