If ClientConfiguration contains password, ClusterHelper must honor it

Description

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

Environment

None

Gerrit Reviews

None

Release Notes Description

None

Attachments

3
  • 14 Feb 2015, 10:37 PM
  • 14 Feb 2015, 12:01 AM
  • 13 Feb 2015, 01:01 PM

Activity

Show:

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 ?

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created February 13, 2015 at 1:01 PM
Updated March 4, 2015 at 1:19 AM
Resolved February 20, 2015 at 11:27 AM
Instabug