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

LCB_ERR_SDK_FEATURE_UNAVAILABLE (1029)], Couldn't create instance. Either bad credentials/hosts/bucket names were passed, or there was an internal error in creating the object

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Major
    • .backlog3.x
    • 3.0.10
    • None
    • None
    • 1

    Description

      Eunice Huang Sep 24th at 9:34 PM

      I still have issues to connect to couchbase server through sdk on one of our mobile QE lab machine. The machine is Mac High Sierra (we intent to keep an old version) with python 3.7, couchbase lib 3.0.10.
      when I try to get a cluster object and use it to create docs, here are what I get:
      self = <[AttributeError("bucket") raised in repr()] Cluster object at 0x108a725f0>, args = ()
      kwargs =

      {'_conntype': 1, 'connection_string': '[couchbases://172.23.136.101?ssl=no_verify&operation_timeout=30.0&query_timeout=300.0] ', 'password': 'password', 'username': 'Administrator'}

      _no_connect_exceptions = False, _cntlopts = {}, strcntls = {}, tc = None
      and stack trace shows:
      > super(Client, self)._init_(*args, **kwargs)
      E couchbase.exceptions.CouchbaseException: <RC=0x405[LCB_ERR_SDK_FEATURE_UNAVAILABLE (1029)], 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)>

      venv/lib/python3.7/site-packages/couchbase_core/client.py:141: CouchbaseException
      31 replies


      Ray Cardillo  1 day ago

      Assuming you've already verified the obvious aspect of what's described in the error message (passing correct info) ...What is the server version and build number? Because there was a known issue with certain versions of libcouchbase circa early versions of v3 when connecting to pre-release versions of v7. If it's that problem, and you upgrade both to at least the latest minor revision, it would be resolved.Otherwise, it is probably what the error message states (passing incorrect info or the cluster/bucket isn't ready). If you're trying to create everything as you go, perhaps you're not waiting long enough for the bucket to be created and it's not yet ready to take requests? (edited) 
      Michael Reiche  1 day ago

      Run SDK Doctor : https://docs.couchbase.com/server/current/sdk/sdk-doctor.html
      On MacOS, you need to change the security settings to run it.  https://issues.couchbase.com/browse/DOC-9137
      Searching issues using the error message/stack trace is sometimes useful:
      https://issues.couchbase.com/issues/?jql=text%20~%20%22LCB_ERR_SDK_FEATURE_UNAVAILABLE%22 https://issues.couchbase.com/issues/?jql=text%20~%20%22%5C%22Either%20bad%20credentials[…]g%20the%20object%2C%5C%22%22%20ORDER%20BY%20created%20DESC (edited) 
      !https://a.slack-edge.com/production-standard-emoji-assets/13.0/apple-small/1f44d.png!1
       
      Michael Reiche  1 day ago

      Some of those bugs suggest sasl_mech_force=PLAIN

      Eunice Huang  24 hours ago

      server version is 7.0.0-5302

      Eunice Huang  23 hours ago

      thanks Michael. I downloaded the sdk doctor tool for macos, it’s a *.dms file (not *.dmg), I am not able to install. can’t find any description for how to use it. any idea?

      Michael Reiche  23 hours ago

      From the link provided ( https://docs.couchbase.com/server/current/sdk/sdk-doctor.html ) click on "Releases Page" ( https://github.com/couchbaselabs/sdk-doctor/releases ). The second link under "Assets" is sdk-doctor-macos ( https://github.com/couchbaselabs/sdk-doctor/releases/download/v1.0.8/sdk-doctor-macos ) There is no extension on the file.  Download and (attempt to) run it.  There will be a complaint that it isn't signed.  Go to System Preferences -> Security & Privacy -> General. Click the lock at the bottom to unlock to make changes. There should be a button to allow execution of sdk-doctor-macos.

      Michael Reiche  23 hours ago

      Safari will rename downloads to .dms files. (edited) 

      Michael Reiche  23 hours ago

      just rename it to sdk-doctor-macos and run

      Eunice Huang  23 hours ago

      thanks a lot

      Michael Reiche  23 hours ago

      I didn't know about Safari renaming downloads to .dms. I've added that to the doc bug.

      Eunice Huang  20 hours ago

      actually I downloaded through chrome browser

      Michael Reiche  20 hours ago

      Did renaming and running work?
      Google doesn't seem to know about any issues with Chrome adding .dms to downloaded file names. Just Safari. (edited) 

      Eunice Huang  19 hours ago

      renaming works, thank you. i also need to chmod beside granting permission through macos security/privacy preferences

      Eunice Huang  19 hours ago

      actually probably I didn’t notice that I used Safari originally on my first download try. sorry about that.
      I just retried from Chrome and it downloaded without extension.

      Eunice Huang  17 hours ago

      from this log, do we know what’s going on?
      sdk-doctor-log.txt 
      Mobile-QE-mac-laptop1:temp couchbase$ ./sdk-doctor-macos diagnose couchbases://172.23.136.115/travel-sample -u Administrator -p password

      Note: Diagnostics can only provide accurate results when your cluster
      is in a stable state. Active rebalancing and other cluster configuration
      changes can cause the output of the doctor to be inconsistent or in the
      worst cases, completely incorrect.
       
      17:50:52.947 INFO ▶ Parsing connection string `couchbases://172.23.136.115/travel-sample`
      17:50:52.948 INFO ▶ Connection string specifies to use secured connections
      17:50:52.948 INFO ▶ Connection string identifies the following CCCP endpoints:
      17:50:52.948 INFO ▶ 1. 172.23.136.115:11207
      17:50:52.948 INFO ▶ Connection string identifies the following HTTP endpoints:
      17:50:52.948 INFO ▶ 1. 172.23.136.115:18091
      17:50:52.948 INFO ▶ Connection string specifies bucket `travel-sample`
      17:50:52.948 WARN ▶ No certificate authority file specified (--tls-ca), skipping server certificate verification for this run.
      17:50:52.948 WARN ▶ Your connection string specifies only a single host. You should consider adding additional static nodes from your cluster to this list to improve your applications fault-tolerance
      17:50:52.948 INFO ▶ Performing DNS lookup for host `172.23.136.115`
      17:50:52.948 INFO ▶ Attempting to connect to cluster via CCCP
      17:50:52.948 INFO ▶ Attempting to fetch config via cccp from `172.23.136.115:11207`
      17:50:52.981 INFO ▶ Selected the following network type: default
      17:50:52.981 INFO ▶ Identified the following nodes:
      17:50:52.981 INFO ▶ [0] 172.23.136.115
      17:50:52.981 INFO ▶ capiSSL: 18092, indexHttp: 9102, mgmtSSL: 18091
      17:50:52.981 INFO ▶ capi: 8092, indexStreamCatchup: 9104, kv: 11210
      17:50:52.981 INFO ▶ mgmt: 8091, n1ql: 8093, n1qlSSL: 18093
      17:50:52.981 INFO ▶ indexAdmin: 9100, indexScan: 9101, indexStreamInit: 9103
      17:50:52.981 INFO ▶ indexStreamMaint: 9105, indexHttps: 19102, kvSSL: 11207
      17:50:52.981 INFO ▶ projector: 9999
      17:50:52.981 INFO ▶ Fetching config from `https://172.23.136.115:18091`
      17:50:53.023 INFO ▶ Received cluster configuration, nodes list:
      [
      {
      "addressFamily": "inet",
      "addressFamilyOnly": false,
      "clusterCompatibility": 458752,
      "clusterMembership": "active",
      "configuredHostname": "172.23.136.115:8091",
      "couchApiBase": "http://172.23.136.115:8092/",
      "couchApiBaseHTTPS": "https://172.23.136.115:18092/",
      "cpuCount": 4,
      "externalListeners": [

      { "afamily": "inet", "nodeEncryption": false }

      ],
      "hostname": "172.23.136.115:8091",
      "interestingStats":

      { "cmd_get": 0, "couch_docs_actual_disk_size": 8471326, "couch_docs_data_size": 407028, "couch_spatial_data_size": 0, "couch_spatial_disk_size": 0, "couch_views_actual_disk_size": 0, "couch_views_data_size": 0, "curr_items": 0, "curr_items_tot": 0, "ep_bg_fetched": 0, "get_hits": 0, "mem_used": 27987688, "ops": 0, "vb_active_num_non_resident": 0, "vb_replica_curr_items": 0 }

      ,
      "mcdMemoryAllocated": 6236,
      "mcdMemoryReserved": 6236,
      "memoryFree": 6820372480,
      "memoryTotal": 8173850624,
      "nodeEncryption": false,
      "nodeUUID": "c5ba434cce6ee29fcec80fbba0f97b63",
      "os": "x86_64-unknown-linux-gnu",
      "otpNode": "ns_1@172.23.136.115",
      "ports":

      { "direct": 11210, "distTCP": 21100, "distTLS": 21150, "httpsCAPI": 18092, "httpsMgmt": 18091 }

      ,
      "recoveryType": "none",
      "services": [
      "index",
      "kv",
      "n1ql"
      ],
      "status": "healthy",
      "systemStats":

      { "allocstall": 0, "cpu_cores_available": 4, "cpu_stolen_rate": 0.4034291477559254, "cpu_utilization_rate": 2.168431669188099, "mem_free": 6820372480, "mem_limit": 8173850624, "mem_total": 8173850624, "swap_total": 3758092288, "swap_used": 0 }

      ,
      "thisNode": true,
      "uptime": "16605",
      "version": "7.0.0-5302-enterprise"
      }
      ]
      17:50:53.049 INFO ▶ Successfully connected to Key Value service at `172.23.136.115:11207`
      17:50:53.082 INFO ▶ Successfully connected to Management service at `172.23.136.115:18091`
      17:50:53.107 INFO ▶ Successfully connected to Views service at `172.23.136.115:18092`
      17:50:53.127 INFO ▶ Successfully connected to Query service at `172.23.136.115:18093`
      17:50:53.127 WARN ▶ Could not test Search service on `172.23.136.115` as it was not in the config
      17:50:53.127 WARN ▶ Could not test Analytics service on `172.23.136.115` as it was not in the config
      17:50:53.188 INFO ▶ Memd Nop Pinged `172.23.136.115:11207` 10 times, 0 errors, 3ms min, 4ms max, 3ms mean
      17:50:53.188 INFO ▶ Diagnostics completed
       
      Summary:
      [WARN] No certificate authority file specified (--tls-ca), skipping server certificate verification for this run.
      [WARN] Your connection string specifies only a single host. You should consider adding additional static nodes from your cluster to this list to improve your applications fault-tolerance
      [WARN] Could not test Search service on `172.23.136.115` as it was not in the config
      [WARN] Could not test Analytics service on `172.23.136.115` as it was not in the config
      Collapse
       
       

      Michael Reiche  16 hours ago

      I see some warnings, but nothing seems to be broken.
      Maybe try couchbase:// (instead of couchbases)?
      Did you find anything relevant in the issues with the same errors?
      Did you try sasl_mech_force=PLAIN?
      @sdk-dev-c-based to get the attention of the python-sdk folks.

      Brett Lawson  16 hours ago

      Feature not available is interesting.  What is the first op your trying to perform?  @Jared Casey @David Kelly for visibility.

      David Kelly  16 hours ago

      oh — just saw this…. I believe sasl_mech_force=PLAIN is needed in the connection string, as @Brett and @Michael Reiche mentioned.  I’d also be curious to see the code that reproduces the error, after adding that to the connection string.

      Jared Casey  15 hours ago

        What @David Kelly said.  Also, would be nice to see some logs (docs here, set LCB_LOGLEVEL=5). (edited) 

      Eunice Huang  13 hours ago

      when I set url with couchbase:// it connects, but in reality, the server has ssl enabled, for the same server, I can connect with couchbases:// from another macos machine.
      I wonder what certificate has missed on the macos I have problem with?

      Eunice Huang  13 hours ago

      thank you very much for all the helps. I did set LCB_LOGLEVEL, but the sdk doctor shows the same log. also tried sasl_mech_force=PLAIN and  searched in the documentation, but didn’t get straightforward information for how to set it right. sorry I am a newbie in using sdk.

      Eunice Huang  12 hours ago

      added sasl_mech_force=PLAIN to couchbases:// didn’t help

      Matt Ingenthron   4 hours ago

      Look in the log to see if it is using plain, and still failing. Or, look at the server logs.  Because of the nature of what you're doing, the client doesn't know much. The client asserts creds, the server enforces and logs.

      David Kelly  4 hours ago

      Also a code sample could help - if you can upload it here we can take a look.

      Eunice Huang  2 hours ago

      cbs_host = "172.23.136.115"
      bucket_name = "travel-sample"
      connection_url = "couchbases://{}?sasl_mech_force=PLAIN&ssl=no_verify".format(cbs_host)

      logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
      couchbase.enable_logging()

      cluster = Cluster(connection_url, ClusterOptions(PasswordAuthenticator("Administrator","password")))

      Eunice Huang  2 hours ago

      btw, the ip address is from a dynamic vm, only valid yesterday, if you try now, it’s no longer accessible or has been rotated for other vm.

      Michael Reiche  2 hours ago

      "I did set LCB_LOGLEVEL, but the sdk doctor shows the same log."
      They meant set it before running your program (not sdk-doctor).

      Michael Reiche  2 hours ago

      Please show the rest of your code (what comes after cluster = Cluster(....).

      Michael Reiche  2 hours ago

      Ok - so definitely an SSL issue.
      when I set url with couchbase:// it connects, but in reality, the server has ssl enabled, for the same server, I can connect with couchbases:// from another macos machine.
      I wonder what certificate has missed on the macos I have problem with?

      Michael Reiche  2 hours ago

      Maybe running sdk-doctor with --tls-ca will give some more information?
      > [WARN] No certificate authority file specified (--tls-ca), skipping server certificate verification for this run.

      Michael Reiche  24 minutes ago

      > I can connect with couchbases:// from another macos machine.
      Does the non-working client have a copy of the certificate used by the couchbase server? The last section in -
      https://docs.couchbase.com/server/current/manage/manage-security/configure-client-certificates.html

      Attachments

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

        Activity

          People

            jared.casey Jared Casey
            michael.reiche Michael Reiche
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty