Details
-
Task
-
Resolution: Unresolved
-
Major
-
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 =
_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
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
server version is 7.0.0-5302
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?
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.
Safari will rename downloads to .dms files. (edited)
just rename it to sdk-doctor-macos and run
thanks a lot
I didn't know about Safari renaming downloads to .dms. I've added that to the doc bug.
actually I downloaded through chrome browser
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)
renaming works, thank you. i also need to chmod beside granting permission through macos security/privacy preferences
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.
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": [
],
"hostname": "172.23.136.115:8091",
"interestingStats":
,
"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":
,
"recoveryType": "none",
"services": [
"index",
"kv",
"n1ql"
],
"status": "healthy",
"systemStats":
,
"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
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.
Feature not available is interesting. What is the first op your trying to perform? @Jared Casey @David Kelly for visibility.
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)
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?
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.
added sasl_mech_force=PLAIN to couchbases:// didn’t help
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.
Also a code sample could help - if you can upload it here we can take a look.
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")))
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.
"I did set LCB_LOGLEVEL, but the sdk doctor shows the same log."
They meant set it before running your program (not sdk-doctor).
Please show the rest of your code (what comes after cluster = Cluster(....).
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?
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.
> 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