Description
From https://forums.couchbase.com/t/perhaps-a-bug-with-new-couchbase-5-passwordauthenticator/13126
When I initiate cluster configuration using app.config. In this case, I cannot open a bucket using authenticator. However, if I run almost identical code, where I create new cluster and only set server list for it, everything is working as expected and I can open a bucket with correct credentials.
How to replicate (code that produces exception):
Cluster cluster = new Cluster(configurationSectionName: "couchbaseClients/couchbase"); var auth = new Couchbase.Authentication.PasswordAuthenticator(userName, password); cluster.Authenticate(auth); return cluster.OpenBucket(bucketName); |
Exceptions:
"Could not bootstrap - check inner exceptions for details."
"One or more errors occurred."
The same bucket and the same credentials can open a bucket successfully if initialized like this:
Cluster cluster = new Cluster( new Couchbase.Configuration.Client.ClientConfiguration() { //Servers = _Cluster.Configuration.Servers - it works too, here _Cluster is initialized using app.config Servers = new List<Uri> { new Uri("http://xxx.xxx.xxx.xxxx:8091") } } ); var auth = new Couchbase.Authentication.PasswordAuthenticator(userName, password); cluster.Authenticate(auth); |
App.config related to couchbase is:
<configSections> <sectionGroup name="couchbaseClients"> <section name="couchbase" type="Couchbase.Configuration.Client.Providers.CouchbaseClientSection, Couchbase.NetClient" /> </sectionGroup> </configSections> <couchbaseClients> <couchbase useSsl="false"> <servers> <add uri="http://xxx.xxx.xxx.xxx:8091"></add> </servers> <buckets> <add name="xxxxx" password="*******"> <connectionPool name="custom" maxSize="10" minSize="5" sendTimeout="12000">< /connectionPool> </add> </buckets> </couchbase> </couchbaseClients> |
Attachments
For Gerrit Dashboard: NCBC-1445 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
79715,3 | NCBC-1445: Add RBAC config section integration tests | master | couchbase-net-client | Status: MERGED | +2 | +1 |