If ClientConfiguration contains password, ClusterHelper must honor it
Description
Environment
Gerrit Reviews
Release Notes Description
Attachments
- 14 Feb 2015, 10:37 PM
- 14 Feb 2015, 12:01 AM
- 13 Feb 2015, 01:01 PM
Activity

Simon Baslé February 20, 2015 at 11:27 AM

Jeffry Morris February 17, 2015 at 5:46 PM
@fx.algrain -
Very good! I do think the ClusterHelper should pull that from the config if the password has been set in the configuration, though. I am changing the title of the ticket to reflect this.
-Jeff

fx.algrain February 17, 2015 at 1:18 PM
Just forget the previous comment
Finally I found the bug
The ClusterHelper.GetBucket method requires to set the bucket password as parametter instead of get it from the configuration.
So in the demo project, I replace in CouchbaseManager the last line :
return ClusterHelper.GetBucket(BucketName);
by
return ClusterHelper.GetBucket(BucketName, ConfigurationManager.CouchbaseBucketPassword);

fx.algrain February 17, 2015 at 11:44 AM
I clone the project sources from github.
I found the exact line where the exception occurs. File is CarrierPublicationProvider, line 108
var operationResult = ioStrategy.Execute(new Config(Converter, endPoint));
if (operationResult.Success)
var bucketConfig = operationResult.Value;
bucketConfig.SurrogateHost = connectionPool.EndPoint.Address.ToString();
The fact is bucketConfig is null. I don't know why for the moment

fx.algrain February 17, 2015 at 9:52 AM
This issue is critical for our production. Did you need something else ?
Jeff notes: read last couple of comments for context
--------------------------------------------------------------------
Hi,
I m facing with an System.NullReferenceException exception when I try to open a bucket.
When I set localhost as server no issue, but when I set the servers config to production servers I get the exception. I configure the server config as "couchbase-1.exemple.com,couchbase-2.exemple.com" or "couchbase-1.exemple.com"
Please find the demo project as attachment.
The original topic on the formum : https://forums.couchbase.com/t/exception-when-try-to-get-a-bucket/2933