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

Unable to create cluster connection if N2N encryption is enabled

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 3.2.0, 3.0.8
    • None
    • library
    • 1

    Description

      Build: 7.0.2 build 6541

      Python SDK version: 3.2.0

      • Enable N2N encryption on a cluster with strict mode
      • download client certificate and try to load data to cluster 

      import logging
      import sys
       
      import couchbase
      from couchbase.cluster import Cluster, ClusterOptions
      from couchbase_core.cluster import PasswordAuthenticator
       
      logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
      couchbase.enable_logging()
       
      cluster = Cluster("couchbases://172.23.104.146",ClusterOptions(PasswordAuthenticator("Administrator","password",cert_path="/Users/vikaschaudhary/workspace/perf/perfrunner/root.crt")))
      cb=cluster.bucket("bucket-1")
      cb_coll=cb.default_collection()
      result=cb_coll.upsert("111",{"hello"})
      print(result) 

      error

      INFO:couchbase:Initializing Couchbase logging. lcb_version=('3.2.0', 197120)
      Traceback (most recent call last):
        File "/Users/vikaschaudhary/workspace/perf/perfrunner/cb_sdk.py", line 11, in <module>
          cluster = Cluster("couchbases://172.23.104.146",ClusterOptions(PasswordAuthenticator("Administrator","password",cert_path="/Users/vikaschaudhary/workspace/perf/perfrunner/root.crt")))
        File "/Users/vikaschaudhary/workspace/perf/perfrunner/env/lib/python3.6/site-packages/couchbase/cluster.py", line 478, in __init__
          _conntype=_LCB.LCB_TYPE_CLUSTER, **self._clusteropts)
        File "/Users/vikaschaudhary/workspace/perf/perfrunner/env/lib/python3.6/site-packages/couchbase_core/client.py", line 142, in __init__
          super(Client, self).__init__(*args, **kwargs)
      couchbase.exceptions.DlopenFailedException: <RC=0x3F9[LCB_ERR_DLOPEN_FAILED (1017)], Couldn't create instance. Either bad credentials/hosts/bucket names were passed, or there was an internal error in creating the object, C Source=(src/bucket.c,1116)>Process finished with exit code 1 

      Performance testing for N2N encryption is blocked as we are not able to load data 

      Attachments

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

        Activity

          jared.casey Jared Casey added a comment -

          Hi Vikas Chaudhary - I am able to connect to the cluster without any issues. This looks to be something you are running into locally on your machine.

          Can you reinstall the couchbase Python SDK and provide the output of the installation process with added verbosity (see command below)?

          python3 -m pip install --no-cache -v -v -v couchbase
          

          Also, after the Python client has been installed, can you provide the output of the following? Below is what I am seeing locally.

          otool -L ~/.virtualenvs/cb-sample-py3.9.5/lib/python3.9/site-packages/couchbase_core/libcouchbase.2.dylib 
          

          My output is below, I would expect to see something similar.

                  @rpath/libcouchbase.2.dylib (compatibility version 9.0.0, current version 9.0.1)
                  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)
                  /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
                  /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
                  /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
                  /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
                  /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 905.6.0)
          

          jared.casey Jared Casey added a comment - Hi Vikas Chaudhary - I am able to connect to the cluster without any issues. This looks to be something you are running into locally on your machine. Can you reinstall the couchbase Python SDK and provide the output of the installation process with added verbosity (see command below)? python3 -m pip install --no-cache - v - v - v couchbase Also, after the Python client has been installed, can you provide the output of the following? Below is what I am seeing locally. otool -L ~/.virtualenvs /cb-sample-py3 .9.5 /lib/python3 .9 /site-packages/couchbase_core/libcouchbase .2.dylib My output is below, I would expect to see something similar. @rpath/libcouchbase.2.dylib (compatibility version 9.0.0, current version 9.0.1) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5) /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0) /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 905.6.0)

          Jared Casey please find the details below

          vikass:perfrunner vikaschaudhary$ env/bin/pip install --no-cache -v -v -v couchbase
          Using pip 21.2.3 from /Users/vikaschaudhary/workspace/perf/perfrunner/env/lib/python3.6/site-packages/pip (python 3.6)
          Non-user install because user site-packages disabled
          Created temporary directory: /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-ephem-wheel-cache-2q356a_b
          Created temporary directory: /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-req-tracker-_gikll95
          Initialized build tracking at /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-req-tracker-_gikll95
          Created build tracker: /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-req-tracker-_gikll95
          Entered build tracker: /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-req-tracker-_gikll95
          Created temporary directory: /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-install-8vf17koo
          Requirement already satisfied: couchbase in ./env/lib/python3.6/site-packages (3.2.0)
          Requirement already satisfied: wrapt>=1.11.2 in ./env/lib/python3.6/site-packages (from couchbase) (1.12.1)
          Requirement already satisfied: pyrsistent>=0.15.2 in ./env/lib/python3.6/site-packages (from couchbase) (0.17.3)
          Requirement already satisfied: typing-extensions==3.7.4.3 in ./env/lib/python3.6/site-packages (from couchbase) (3.7.4.3)
          Requirement already satisfied: attrs>=19.1.0 in ./env/lib/python3.6/site-packages (from couchbase) (21.2.0)
          Requirement already satisfied: mypy-extensions in ./env/lib/python3.6/site-packages (from couchbase) (0.4.3)
          Requirement already satisfied: durationpy==0.5 in ./env/lib/python3.6/site-packages (from couchbase) (0.5)
          Requirement already satisfied: six==1.15.0 in ./env/lib/python3.6/site-packages (from couchbase) (1.15.0)
          Created temporary directory: /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-unpack-x7nsc625
          1 location(s) to search for versions of pip:
          * https://pypi.org/simple/pip/
          Fetching project page and analyzing links: https://pypi.org/simple/pip/
          Getting page https://pypi.org/simple/pip/
          Found index url https://pypi.org/simple
          Starting new HTTPS connection (1): pypi.org:443
          https://pypi.org:443 "GET /simple/pip/ HTTP/1.1" 200 17657
            Found link https://files.pythonhosted.org/packages/3d/9d/1e313763bdfb6a48977b65829c6ce2a43eaae29ea2f907c8bbef024a7219/pip-0.2.tar.gz#sha256=88bb8d029e1bf4acd0e04d300104b7440086f94cc1ce1c5c3c31e3293aee1f81 (from https://pypi.org/simple/pip/), version: 0.2
            .........
            Found link https://files.pythonhosted.org/packages/e1/63/7c0e553ae0513ebf1858f08030158ff5998324013e0ba4c2e1c00b85df79/pip-21.2.3.tar.gz#sha256=91e66f2a2702e7d2dcc092ed8c5ebe923e69b9997ea28ba25823943bcd3bf820 (from https://pypi.org/simple/pip/) (requires-python:>=3.6), version: 21.2.3
            Found link https://files.pythonhosted.org/packages/ca/31/b88ef447d595963c01060998cb329251648acf4a067721b0452c45527eb8/pip-21.2.4-py3-none-any.whl#sha256=fa9ebb85d3fd607617c0c44aca302b1b45d87f9c2a1649b46c26167ca4296323 (from https://pypi.org/simple/pip/) (requires-python:>=3.6), version: 21.2.4
            Found link https://files.pythonhosted.org/packages/52/e1/06c018197d8151383f66ebf6979d951995cf495629fc54149491f5d157d0/pip-21.2.4.tar.gz#sha256=0eb8a1516c3d138ae8689c0c1a60fde7143310832f9dc77e11d8a4bc62de193b (from https://pypi.org/simple/pip/) (requires-python:>=3.6), version: 21.2.4
          Skipping link: not a file: https://pypi.org/simple/pip/
          Given no hashes to check 177 links for project 'pip': discarding no candidates
          Removed build tracker: '/private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-req-tracker-_gikll95'

          (env) vikass:perfrunner vikaschaudhary$ otool -L env/lib/python3.6/site-packages/couchbase_core/libcouchbase.2.dylib 
          env/lib/python3.6/site-packages/couchbase_core/libcouchbase.2.dylib:
                  @rpath/libcouchbase.2.dylib (compatibility version 9.0.0, current version 9.0.1)
                  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
                  /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
                  /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
                  /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
                  /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
                  /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0) 

          vikas.chaudhary Vikas Chaudhary added a comment - Jared Casey  please find the details below vikass:perfrunner vikaschaudhary$ env/bin/pip install --no-cache -v -v -v couchbase Using pip 21.2.3 from /Users/vikaschaudhary/workspace/perf/perfrunner/env/lib/python3.6/site-packages/pip (python 3.6) Non-user install because user site-packages disabled Created temporary directory: /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-ephem-wheel-cache-2q356a_b Created temporary directory: /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-req-tracker-_gikll95 Initialized build tracking at /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-req-tracker-_gikll95 Created build tracker: /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-req-tracker-_gikll95 Entered build tracker: /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-req-tracker-_gikll95 Created temporary directory: /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-install-8vf17koo Requirement already satisfied: couchbase in ./env/lib/python3.6/site-packages (3.2.0) Requirement already satisfied: wrapt>=1.11.2 in ./env/lib/python3.6/site-packages (from couchbase) (1.12.1) Requirement already satisfied: pyrsistent>=0.15.2 in ./env/lib/python3.6/site-packages (from couchbase) (0.17.3) Requirement already satisfied: typing-extensions==3.7.4.3 in ./env/lib/python3.6/site-packages (from couchbase) (3.7.4.3) Requirement already satisfied: attrs>=19.1.0 in ./env/lib/python3.6/site-packages (from couchbase) (21.2.0) Requirement already satisfied: mypy-extensions in ./env/lib/python3.6/site-packages (from couchbase) (0.4.3) Requirement already satisfied: durationpy==0.5 in ./env/lib/python3.6/site-packages (from couchbase) (0.5) Requirement already satisfied: six==1.15.0 in ./env/lib/python3.6/site-packages (from couchbase) (1.15.0) Created temporary directory: /private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-unpack-x7nsc625 1 location(s) to search for versions of pip: * https://pypi.org/simple/pip/ Fetching project page and analyzing links: https://pypi.org/simple/pip/ Getting page https://pypi.org/simple/pip/ Found index url https://pypi.org/simple Starting new HTTPS connection (1): pypi.org:443 https://pypi.org:443 "GET /simple/pip/ HTTP/1.1" 200 17657 Found link https://files.pythonhosted.org/packages/3d/9d/1e313763bdfb6a48977b65829c6ce2a43eaae29ea2f907c8bbef024a7219/pip-0.2.tar.gz#sha256=88bb8d029e1bf4acd0e04d300104b7440086f94cc1ce1c5c3c31e3293aee1f81 (from https://pypi.org/simple/pip/), version: 0.2 ......... Found link https://files.pythonhosted.org/packages/e1/63/7c0e553ae0513ebf1858f08030158ff5998324013e0ba4c2e1c00b85df79/pip-21.2.3.tar.gz#sha256=91e66f2a2702e7d2dcc092ed8c5ebe923e69b9997ea28ba25823943bcd3bf820 (from https://pypi.org/simple/pip/) (requires-python:>=3.6), version: 21.2.3 Found link https://files.pythonhosted.org/packages/ca/31/b88ef447d595963c01060998cb329251648acf4a067721b0452c45527eb8/pip-21.2.4-py3-none-any.whl#sha256=fa9ebb85d3fd607617c0c44aca302b1b45d87f9c2a1649b46c26167ca4296323 (from https://pypi.org/simple/pip/) (requires-python:>=3.6), version: 21.2.4 Found link https://files.pythonhosted.org/packages/52/e1/06c018197d8151383f66ebf6979d951995cf495629fc54149491f5d157d0/pip-21.2.4.tar.gz#sha256=0eb8a1516c3d138ae8689c0c1a60fde7143310832f9dc77e11d8a4bc62de193b (from https://pypi.org/simple/pip/) (requires-python:>=3.6), version: 21.2.4 Skipping link: not a file: https://pypi.org/simple/pip/ Given no hashes to check 177 links for project 'pip': discarding no candidates Removed build tracker: '/private/var/folders/kq/xnkqrf852zz5f8kmq6g57prc0000gn/T/pip-req-tracker-_gikll95' (env) vikass:perfrunner vikaschaudhary$ otool -L env/lib/python3.6/site-packages/couchbase_core/libcouchbase.2.dylib env/lib/python3.6/site-packages/couchbase_core/libcouchbase.2.dylib: @rpath/libcouchbase.2.dylib (compatibility version 9.0.0, current version 9.0.1) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1) /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0) /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
          vikas.chaudhary Vikas Chaudhary added a comment - - edited

          Jared Casey seeing the same issue even when N2N has not been enabled looks like a local issue. I am able to run the same code from another box and it's working fine.

          vikas.chaudhary Vikas Chaudhary added a comment - - edited Jared Casey  seeing the same issue even when N2N has not been enabled looks like a local issue. I am able to run the same code from another box and it's working fine.

          People

            vikas.chaudhary Vikas Chaudhary
            vikas.chaudhary Vikas Chaudhary
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty