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

Improve client side error message when TLS is enforced on the server side

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.2.2
    • library

    Description

      Refer to CBD-4202

      Attachments

        Issue Links

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

          Activity

            Libcouchbase writes new message like this (see CCBC-1457)

            82ms [I86b08467f555118] {1660363} [ERROR] (bootstrap - L:205) Failed to bootstrap client=0x9d6f90. Error=LCB_ERR_NO_MATCHING_SERVER (1010) (Last=LCB_ERR_CONNECTION_REFUSED (1024)), Message="Unable to bootstrap, check ports and cluster encryption setting"
            

            avsej Sergey Avseyev added a comment - Libcouchbase writes new message like this (see CCBC-1457 ) 82ms [I86b08467f555118] {1660363} [ERROR] (bootstrap - L:205) Failed to bootstrap client=0x9d6f90. Error=LCB_ERR_NO_MATCHING_SERVER (1010) (Last=LCB_ERR_CONNECTION_REFUSED (1024)), Message="Unable to bootstrap, check ports and cluster encryption setting"
            jared.casey Jared Casey added a comment - - edited

            Checked out the commit for LCB – looks good to me.

            Verified in Python client:

            0ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (instance - L:521) Version=3.2.1_12_gc8c37a3ee3, Changeset=c8c37a3ee3ebc23b6a7ec3a86a72d44fa3bbaeb5
            0ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (instance - L:522) Effective connection string: couchbase://ec2-34-215-68-86.us-west-2.compute.amazonaws.com. Bucket=(null)
            57ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (instance - L:212) DNS SRV lookup failed: LCB_ERR_UNKNOWN_HOST (1049). Ignore this if not relying on DNS SRV records
            57ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (instance - L:155) Adding host ec2-34-215-68-86.us-west-2.compute.amazonaws.com:8091 to initial HTTP bootstrap list
            57ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (instance - L:155) Adding host ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210 to initial CCCP bootstrap list
            57ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (instance - L:193) Bootstrap hosts loaded (cccp:1, http:1)
            58ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (bootstrap - L:277) Requested network configuration: heuristic
            58ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (confmon - L:94) Preparing providers (this may be called multiple times)
            58ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (confmon - L:100) Provider CCCP is ENABLED
            58ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (confmon - L:100) Provider HTTP is ENABLED
            58ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (confmon - L:319) Refreshing current cluster map (bucket: (null))
            58ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (cccp - L:176) Requesting connection to node ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210 for CCCP configuration
            58ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (lcbio_mgr - L:501) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (HE=0x7fd03b407770) Creating new connection because none are available in the pool
            58ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (lcbio_mgr - L:413) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (HE=0x7fd03b407770) New pool entry: I=0x7fd03b40d990
            58ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (connection - L:497) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (SOCK=df0c7783e886c9cf) Starting. Timeout=2000000us
            60ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (connection - L:262) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (SOCK=df0c7783e886c9cf) Created new socket with FD=5
            60ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (connection - L:362) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (SOCK=df0c7783e886c9cf) Scheduling I/O watcher for asynchronous connection completion.
            60ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (confmon - L:305) Attempting to retrieve cluster map via CCCP
            119ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (connection - L:378) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (SOCK=df0c7783e886c9cf) connect() failed. errno=61 [Connection refused]
            119ms [I7339a6d36bfd4dc3] {37707/103} [ERROR] (connection - L:168) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (SOCK=df0c7783e886c9cf) Failed to establish connection: LCB_ERR_CONNECTION_REFUSED (1024), os errno=61
            119ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (lcbio_mgr - L:369) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (HE=0x7fd03b407770) Received result for I=0x7fd03b40d990,C=0x0; E=0x400
            119ms [I7339a6d36bfd4dc3] {37707/103} [ERROR] (cccp - L:187) <NOHOST:NOPORT> (CTX=0x0,) Could not get configuration: LCB_ERR_CONNECTION_REFUSED (1024)
            120ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (confmon - L:216) Provider 'CCCP' failed: LCB_ERR_CONNECTION_REFUSED (1024)
            120ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (confmon - L:260) Will try next provider in 0us
            120ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (confmon - L:305) Attempting to retrieve cluster map via HTTP
            120ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (htconfig - L:359) Starting HTTP Configuration Provider 0x7fd02b57a7f0
            120ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (connection - L:497) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:8091> (SOCK=d2f8e8eb36c4d604) Starting. Timeout=2000000us
            120ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (connection - L:262) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:8091> (SOCK=d2f8e8eb36c4d604) Created new socket with FD=5
            120ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (connection - L:362) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:8091> (SOCK=d2f8e8eb36c4d604) Scheduling I/O watcher for asynchronous connection completion.
            182ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (connection - L:378) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:8091> (SOCK=d2f8e8eb36c4d604) connect() failed. errno=61 [Connection refused]
            182ms [I7339a6d36bfd4dc3] {37707/103} [ERROR] (connection - L:168) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:8091> (SOCK=d2f8e8eb36c4d604) Failed to establish connection: LCB_ERR_CONNECTION_REFUSED (1024), os errno=61
            182ms [I7339a6d36bfd4dc3] {37707/103} [ERROR] (htconfig - L:309) Connection to REST API failed with LCB_ERR_CONNECTION_REFUSED (1024) (os errno = 61)
            182ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (confmon - L:216) Provider 'HTTP' failed: LCB_ERR_CONNECTION_REFUSED (1024)
            182ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (confmon - L:265) Maximum provider reached. Resetting index
            182ms [I7339a6d36bfd4dc3] {37707/103} [ERROR] (bootstrap - L:205) Failed to bootstrap client=0x7fd02b5b6fe0. Error=LCB_ERR_NO_MATCHING_SERVER (1010) (Last=LCB_ERR_CONNECTION_REFUSED (1024)), Message="Unable to bootstrap, check ports and cluster encryption setting"
            Traceback (most recent call last):
              File "./test.py", line 7, in <module>
                ClusterOptions(PasswordAuthenticator("Administrator", "password")))
              File "/Users/jaredcasey/GIT/couchbase/clients/python/couchbase-python-client/couchbase/cluster.py", line 563, in __init__
                **self._clusteropts
              File "/Users/jaredcasey/GIT/couchbase/clients/python/couchbase-python-client/couchbase_core/client.py", line 160, in __init__
                self._do_ctor_connect()
              File "/Users/jaredcasey/GIT/couchbase/clients/python/couchbase-python-client/couchbase/cluster.py", line 585, in _do_ctor_connect
                super(Cluster, self)._do_ctor_connect(*args, **kwargs)
              File "/Users/jaredcasey/GIT/couchbase/clients/python/couchbase-python-client/couchbase_core/client.py", line 169, in _do_ctor_connect
                self._connect()
            couchbase.exceptions.LCB_0x400 (generated, catch: BaseException, KeyValueException, QueryException, AnalyticsException, SearchException, ViewException): <RC=0x400[LCB_ERR_CONNECTION_REFUSED (1024)], There was a problem while trying to send/receive your request over the network. This may be a result of a bad network or a misconfigured client or server, C Source=(src/bucket.c,1209)>
            
            

            jared.casey Jared Casey added a comment - - edited Checked out the commit for LCB – looks good to me. Verified in Python client: 0ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (instance - L:521) Version=3.2.1_12_gc8c37a3ee3, Changeset=c8c37a3ee3ebc23b6a7ec3a86a72d44fa3bbaeb5 0ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (instance - L:522) Effective connection string: couchbase://ec2-34-215-68-86.us-west-2.compute.amazonaws.com. Bucket=(null) 57ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (instance - L:212) DNS SRV lookup failed: LCB_ERR_UNKNOWN_HOST (1049). Ignore this if not relying on DNS SRV records 57ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (instance - L:155) Adding host ec2-34-215-68-86.us-west-2.compute.amazonaws.com:8091 to initial HTTP bootstrap list 57ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (instance - L:155) Adding host ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210 to initial CCCP bootstrap list 57ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (instance - L:193) Bootstrap hosts loaded (cccp:1, http:1) 58ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (bootstrap - L:277) Requested network configuration: heuristic 58ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (confmon - L:94) Preparing providers (this may be called multiple times) 58ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (confmon - L:100) Provider CCCP is ENABLED 58ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (confmon - L:100) Provider HTTP is ENABLED 58ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (confmon - L:319) Refreshing current cluster map (bucket: (null)) 58ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (cccp - L:176) Requesting connection to node ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210 for CCCP configuration 58ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (lcbio_mgr - L:501) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (HE=0x7fd03b407770) Creating new connection because none are available in the pool 58ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (lcbio_mgr - L:413) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (HE=0x7fd03b407770) New pool entry: I=0x7fd03b40d990 58ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (connection - L:497) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (SOCK=df0c7783e886c9cf) Starting. Timeout=2000000us 60ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (connection - L:262) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (SOCK=df0c7783e886c9cf) Created new socket with FD=5 60ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (connection - L:362) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (SOCK=df0c7783e886c9cf) Scheduling I/O watcher for asynchronous connection completion. 60ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (confmon - L:305) Attempting to retrieve cluster map via CCCP 119ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (connection - L:378) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (SOCK=df0c7783e886c9cf) connect() failed. errno=61 [Connection refused] 119ms [I7339a6d36bfd4dc3] {37707/103} [ERROR] (connection - L:168) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (SOCK=df0c7783e886c9cf) Failed to establish connection: LCB_ERR_CONNECTION_REFUSED (1024), os errno=61 119ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (lcbio_mgr - L:369) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:11210> (HE=0x7fd03b407770) Received result for I=0x7fd03b40d990,C=0x0; E=0x400 119ms [I7339a6d36bfd4dc3] {37707/103} [ERROR] (cccp - L:187) <NOHOST:NOPORT> (CTX=0x0,) Could not get configuration: LCB_ERR_CONNECTION_REFUSED (1024) 120ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (confmon - L:216) Provider 'CCCP' failed: LCB_ERR_CONNECTION_REFUSED (1024) 120ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (confmon - L:260) Will try next provider in 0us 120ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (confmon - L:305) Attempting to retrieve cluster map via HTTP 120ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (htconfig - L:359) Starting HTTP Configuration Provider 0x7fd02b57a7f0 120ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (connection - L:497) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:8091> (SOCK=d2f8e8eb36c4d604) Starting. Timeout=2000000us 120ms [I7339a6d36bfd4dc3] {37707/103} [DEBUG] (connection - L:262) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:8091> (SOCK=d2f8e8eb36c4d604) Created new socket with FD=5 120ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (connection - L:362) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:8091> (SOCK=d2f8e8eb36c4d604) Scheduling I/O watcher for asynchronous connection completion. 182ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (connection - L:378) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:8091> (SOCK=d2f8e8eb36c4d604) connect() failed. errno=61 [Connection refused] 182ms [I7339a6d36bfd4dc3] {37707/103} [ERROR] (connection - L:168) <ec2-34-215-68-86.us-west-2.compute.amazonaws.com:8091> (SOCK=d2f8e8eb36c4d604) Failed to establish connection: LCB_ERR_CONNECTION_REFUSED (1024), os errno=61 182ms [I7339a6d36bfd4dc3] {37707/103} [ERROR] (htconfig - L:309) Connection to REST API failed with LCB_ERR_CONNECTION_REFUSED (1024) (os errno = 61) 182ms [I7339a6d36bfd4dc3] {37707/103} [INFO] (confmon - L:216) Provider 'HTTP' failed: LCB_ERR_CONNECTION_REFUSED (1024) 182ms [I7339a6d36bfd4dc3] {37707/103} [TRACE] (confmon - L:265) Maximum provider reached. Resetting index 182ms [I7339a6d36bfd4dc3] {37707/103} [ERROR] (bootstrap - L:205) Failed to bootstrap client=0x7fd02b5b6fe0. Error=LCB_ERR_NO_MATCHING_SERVER (1010) (Last=LCB_ERR_CONNECTION_REFUSED (1024)), Message="Unable to bootstrap, check ports and cluster encryption setting" Traceback (most recent call last): File "./test.py", line 7, in <module> ClusterOptions(PasswordAuthenticator("Administrator", "password"))) File "/Users/jaredcasey/GIT/couchbase/clients/python/couchbase-python-client/couchbase/cluster.py", line 563, in __init__ **self._clusteropts File "/Users/jaredcasey/GIT/couchbase/clients/python/couchbase-python-client/couchbase_core/client.py", line 160, in __init__ self._do_ctor_connect() File "/Users/jaredcasey/GIT/couchbase/clients/python/couchbase-python-client/couchbase/cluster.py", line 585, in _do_ctor_connect super(Cluster, self)._do_ctor_connect(*args, **kwargs) File "/Users/jaredcasey/GIT/couchbase/clients/python/couchbase-python-client/couchbase_core/client.py", line 169, in _do_ctor_connect self._connect() couchbase.exceptions.LCB_0x400 (generated, catch: BaseException, KeyValueException, QueryException, AnalyticsException, SearchException, ViewException): <RC=0x400[LCB_ERR_CONNECTION_REFUSED (1024)], There was a problem while trying to send/receive your request over the network. This may be a result of a bad network or a misconfigured client or server, C Source=(src/bucket.c,1209)>

            People

              jared.casey Jared Casey
              arun.vijayraghavan Arun Vijayraghavan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty