CouchbaseClient.Get(...) Returns no data

FYI, I posted this question earlier and then tried to edit the question with a code sample and additional information. When I tried to update the post, I got an error that said access denied and now it looks like the original has disappeared. Just a disclaimer if the original comes back. Anyway....

I have yet to successfully get any data using CouchbaseClient.Get(..). I have everything installed on my dev laptop and only one instance of the Couchbase server running. I have been working with the sample buckets.

public class CBTest
{
private CouchbaseClient _client;
private CouchbaseClientConfiguration _clientConfig;

public CBTest()
{
_clientConfig = GetCCConfig();
if (_clientConfig == null)
_client = new CouchbaseClient();
else
_client = new CouchbaseClient(_clientConfig);
}

public void Start()
{
var savedBeer = _client.Get("new_holland_brewing_company-sundog");
Console.WriteLine(savedBeer);
bool worked = _client.TryGet("512_brewing_company", out savedBeer);
Console.WriteLine(savedBeer);
}

private CouchbaseClientConfiguration GetCCConfig()
{
_clientConfig = new CouchbaseClientConfiguration();
_clientConfig.Username = "Administrator";
_clientConfig.Bucket = "beer-sample";
_clientConfig.BucketPassword = "";
_clientConfig.Urls.Add(new Uri("http://192.168.52.1:8091/pools"));
return _clientConfig;
//to test settings configured in app.config, comment out the contents of this function out and return null
}
}
_client.Get() always returns null.

Here are the log entries:

2013-11-18 16:23:28,223 [9] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Starting the listener. Queue=True
2013-11-18 16:23:28,225 [10] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Started working.
2013-11-18 16:23:28,245 [10] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Looking for the first working node.
2013-11-18 16:23:28,287 [10] ERROR Couchbase.BucketConfigListener [(null)] <(null)> - Error resolving streaming uri: http://127.0.0.1:8091/pools
System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadString(Uri address)
at Couchbase.ConfigHelper.DeserializeUri[T](WebClient client, Uri uri, IEnumerable`1 converters)
at Couchbase.ConfigHelper.GetPoolsConfigUri(WebClient client, Uri clusterUrl)
at Couchbase.ConfigHelper.ResolveBucket(WebClient client, Uri bootstrapUri, String name)
at Couchbase.BucketConfigListener.ResolveBucketUri(WebClientWithTimeout client, Uri root, String bucketName)
2013-11-18 16:23:28,289 [10] WARN Couchbase.MessageStreamListener [(null)] <(null)> - Could not resolve url http://127.0.0.1:8091/pools; trying the next in the list
2013-11-18 16:23:28,290 [10] WARN Couchbase.MessageStreamListener [(null)] <(null)> - Could not found a working node.
2013-11-18 16:23:28,290 [10] WARN Couchbase.MessageStreamListener [(null)] <(null)> - All nodes are dead, sleeping for a while.
2013-11-18 16:23:28,291 [10] INFO Couchbase.CouchbasePool [(null)] <(null)> - Received new configuration.
2013-11-18 16:23:28,292 [10] INFO Couchbase.CouchbasePool [(null)] <(null)> - Config is empty, all nodes are down.
2013-11-18 16:23:28,293 [10] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Processing message:
2013-11-18 16:23:32,558 [9] DEBUG Couchbase.CouchbasePool [(null)] <(null)> - this.state was null, returning null node for key 'new_holland_brewing_company-sundog'
2013-11-18 16:23:37,574 [9] DEBUG Couchbase.CouchbasePool [(null)] <(null)> - this.state was null, returning null node for key '512_brewing_company'
2013-11-18 16:23:41,570 [10] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Looking for the first working node.
2013-11-18 16:23:41,583 [10] ERROR Couchbase.BucketConfigListener [(null)] <(null)> - Error resolving streaming uri: http://127.0.0.1:8091/pools
System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadString(Uri address)
at Couchbase.ConfigHelper.DeserializeUri[T](WebClient client, Uri uri, IEnumerable`1 converters)
at Couchbase.ConfigHelper.GetPoolsConfigUri(WebClient client, Uri clusterUrl)
at Couchbase.ConfigHelper.ResolveBucket(WebClient client, Uri bootstrapUri, String name)
at Couchbase.BucketConfigListener.ResolveBucketUri(WebClientWithTimeout client, Uri root, String bucketName)
2013-11-18 16:23:41,583 [10] WARN Couchbase.MessageStreamListener [(null)] <(null)> - Could not resolve url http://127.0.0.1:8091/pools; trying the next in the list
2013-11-18 16:23:41,583 [10] WARN Couchbase.MessageStreamListener [(null)] <(null)> - Could not found a working node.
2013-11-18 16:23:41,583 [10] WARN Couchbase.MessageStreamListener [(null)] <(null)> - All nodes are dead, sleeping for a while.
2013-11-18 16:23:41,584 [10] INFO Couchbase.CouchbasePool [(null)] <(null)> - Received new configuration.
2013-11-18 16:23:41,584 [10] INFO Couchbase.CouchbasePool [(null)] <(null)> - Config is empty, all nodes are down.
2013-11-18 16:23:41,584 [10] DEBUG Couchbase.MessageStreamListener [(null)] <(null)> - Processing message:

I see the entry Error resolving streaming uri: http://127.0.0.1:8091/pools
System.Net.WebException: The remote server returned an error: (401) Unauthorized.

Not sure what this means, I can paste the url in a browser and it returns a Json document.

It looks like perhaps an authentication issue - don't see a password for the "Administrator" user...usually this is "password" by default. Do you have the correct bucket name and password? Also, I noticed that the url in the log messages and what you have above that in GetCConfig() method are different.

1 Answer

« Back to question.

Thanks for the reply. I do specify a password, I just removed it when I posted the message. The log messages have been the same, I've tried multiple keys, I may have changed it from the last time I grabbed the logs.

I have de some problem, im my case the error is: 2014-03-06 21:33:51,881 [155645] DEBUG - this.state was null, returning null node for key 'cpc54203_01' [por Couchbase.CouchbasePool]